From b185d95e9347d2a58940a7809e869b9ac6955f06 Mon Sep 17 00:00:00 2001 From: BennyKok Date: Fri, 22 Dec 2023 12:59:05 +0800 Subject: [PATCH] fix(plugin): try catch update run endpoint call --- custom_routes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_routes.py b/custom_routes.py index 49ce446..ab047b2 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -202,7 +202,13 @@ def update_run(prompt_id, status: Status): "status": status.value, } prompt_metadata[prompt_id]['status'] = status - requests.post(status_endpoint, json=body) + + 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"):