Skip to content

Commit 245bb1a

Browse files
committed
Add try catch in failure cb
1 parent f18acb1 commit 245bb1a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

llmstack/sheets/tasks.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,14 +618,17 @@ def on_sheet_run_success(job, connection, result, *args, **kwargs):
618618

619619

620620
def on_sheet_run_failed(job, connection, type, value, traceback):
621-
sheet_uuid = job.args[0]
622-
run_uuid = job.args[1]
621+
try:
622+
sheet_uuid = job.args[0]
623+
run_uuid = job.args[1]
623624

624-
async_to_sync(channel_layer.group_send)(
625-
run_uuid, {"type": "sheet.error", "error": f"Sheet run failed: {str(type)} - {str(value)}"}
626-
)
625+
async_to_sync(channel_layer.group_send)(
626+
run_uuid, {"type": "sheet.error", "error": f"Sheet run failed: {str(type)} - {str(value)}"}
627+
)
627628

628-
update_sheet_with_post_run_data(sheet_uuid, run_uuid)
629+
update_sheet_with_post_run_data(sheet_uuid, run_uuid)
630+
except Exception:
631+
logger.exception("Error in on_sheet_run_failed")
629632

630633

631634
def on_sheet_run_stopped(job, connection):

0 commit comments

Comments
 (0)