Skip to content

Commit 77d14c9

Browse files
committed
Catch job cancellation exceptions
1 parent c134286 commit 77d14c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llmstack/sheets/apis.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ def cancel_run(self, request, sheet_uuid=None, run_id=None):
309309

310310
if run_id_in_sheet != run_id:
311311
return DRFResponse(status=status.HTTP_400_BAD_REQUEST)
312-
PromptlySheetAppExecuteJob.cancel(job_id)
312+
313+
try:
314+
PromptlySheetAppExecuteJob.cancel(job_id)
315+
except Exception as e:
316+
logger.error(f"Error cancelling job {job_id}: {e}")
313317

314318
sheet.extra_data["running"] = False
315319
sheet.extra_data["job_id"] = None

0 commit comments

Comments
 (0)