Skip to content

Commit a248ab5

Browse files
authored
sdk automation, add global catch and log (Azure#44591)
* logging unknown error * nit, comment
1 parent 3df808c commit a248ab5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

eng/automation/generate.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ def sdk_automation(input_file: str, output_file: str):
111111
with open(input_file, "r") as fin:
112112
config = json.load(fin)
113113

114-
# typespec
115-
packages = sdk_automation_typespec(config)
116-
# autorest
117-
if not packages:
118-
packages = sdk_automation_autorest(config)
114+
packages = []
115+
try:
116+
# typespec
117+
packages = sdk_automation_typespec(config)
118+
# autorest
119+
if not packages:
120+
packages = sdk_automation_autorest(config)
121+
except Exception:
122+
logging.error("[GENERATE] Code generation failed. Unknown exception", exc_info=True)
119123

120124
with open(output_file, "w", encoding="utf-8") as fout:
121125
output = {

0 commit comments

Comments
 (0)