fix(plugin): try catch update run endpoint call

This commit is contained in:
BennyKok 2023-12-22 12:59:05 +08:00
parent 2690db12b5
commit b185d95e93

View File

@ -202,7 +202,13 @@ def update_run(prompt_id, status: Status):
"status": status.value,
}
prompt_metadata[prompt_id]['status'] = status
try:
requests.post(status_endpoint, json=body)
except Exception as e:
error_type = type(e).__name__
stack_trace = traceback.format_exc().strip()
print(f"Error occurred while updating run: {e} {stack_trace}")
async def upload_file(prompt_id, filename, subfolder=None, content_type="image/png", type="output"):