Skip to content

Commit 784ad02

Browse files
committed
Support run ondemand Automation-API Control-M
1 parent 2377a37 commit 784ad02

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ctm_python_client/core/workflow.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,12 @@ def run_on_demand(self, skip_login: bool = False, file_path: str = None, delete_
438438
run_.open_in_browser()
439439
return run_
440440
except Exception as e:
441-
errors = [err.get('message', '') + ' ' + err.get('item', '')
442-
for err in json.loads(e.body)['errors']]
443-
raise RuntimeError(f"AAPI request failed: {', '.join(errors)}")
441+
if e.body:
442+
errors = [err.get('message', '') + ' ' + err.get('item', '')
443+
for err in json.loads(e.body)['errors']]
444+
raise RuntimeError(f"AAPI request failed: {', '.join(errors)}")
445+
else:
446+
raise e
444447
finally:
445448
if delete_afterwards:
446449
fpath.unlink()

0 commit comments

Comments
 (0)