updated exception handling when running commands from runner script
This commit is contained in:
+7
-1
@@ -79,7 +79,13 @@ def handle_event(request: GiteaRequest):
|
||||
requirements_path = local_repo_dir / pipeline.requirements
|
||||
os.system(f'pip install -r {requirements_path}')
|
||||
for cmd in pipeline.script:
|
||||
print(cmd)
|
||||
try:
|
||||
os.system(cmd)
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
status_code=503,
|
||||
detail=f'failed running {cmd}: {e}'
|
||||
)
|
||||
|
||||
# send response
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user