Skip to content

Commit 12306c5

Browse files
committed
try catch
1 parent b58fa1a commit 12306c5

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tools/azure-sdk-tools/packaging_tools/sdk_package.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ def main(generate_input, generate_output):
4141
package["artifacts"] = [str(dist_path / package_file) for package_file in os.listdir(dist_path)]
4242
package["result"] = "succeeded"
4343
# Generate api stub File
44-
package_path = Path(sdk_folder, folder_name, package_name)
45-
check_call(["python", "-m" "pip", "install", "-r", "../../../eng/apiview_reqs.txt",
46-
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
47-
"/simple/"], cwd=package_path)
48-
check_call(["apistubgen", "--pkg-path", "."], cwd=package_path)
49-
for file in os.listdir(package_path):
50-
if "_python.json" in file:
51-
package["apiViewArtifact"] = str(Path(package_path, file))
44+
try:
45+
package_path = Path(sdk_folder, folder_name, package_name)
46+
check_call(["python", "-m" "pip", "install", "-r", "../../../eng/apiview_reqs.txt",
47+
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
48+
"/simple/"], cwd=package_path)
49+
check_call(["apistubgen", "--pkg-path", "."], cwd=package_path)
50+
for file in os.listdir(package_path):
51+
if "_python.json" in file:
52+
package["apiViewArtifact"] = str(Path(package_path, file))
53+
except:
54+
_LOGGER.error(f"Generate ApiView token file failed: [PACKAGE]({package_name})[CHANGELOG]:{md_output}")
5255
# Installation package
5356
package["installInstructions"] = {
5457
"full": "You can install the use using pip install of the artifacts.",

0 commit comments

Comments
 (0)