Skip to content

fix: include function call args in recording_handler exception_handler - #104

Open
tabedzki wants to merge 1 commit into
masterfrom
tabedzki/fix/recording-handler-error-args
Open

fix: include function call args in recording_handler exception_handler#104
tabedzki wants to merge 1 commit into
masterfrom
tabedzki/fix/recording-handler-error-args

Conversation

@tabedzki

@tabedzki tabedzki commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖

Summary

When a workflow function wrapped by exception_handler in u19_pipeline/automatic_job/recording_handler.py fails (e.g. an insert during electrophysiology_preingestion / imaging_preingestion), the resulting error message and Slack notification only contained the exception traceback — with no indication of which recording or arguments triggered it.

This adds a format_call_args helper that builds a truncated (2000-char) repr of the failing call's args/kwargs. It's printed to console and prepended to error_info['error_exception'], so it propagates through to RecordingHandler.update_recording_log (the recording.LogStatus table) and the Slack error notification, making it possible to see which recording/query_key an insert failed on.

Test plan

  • Verified the decorator logic in isolation with a standalone script (mocked config), confirming the failing call's args now appear in error_message/error_exception.
  • Confirmed syntax validity of the edited file with ast.parse.
  • No existing automated tests cover recording_handler.py; manual verification against the running pipeline is recommended before merge.

Assisted-by: ClaudeCode:claude-sonnet-5

When a workflow function decorated with exception_handler fails (e.g. an
insert during modality preingestion), the resulting error message and
Slack notification only contained the exception traceback, with no
indication of which recording/arguments triggered it. This adds a
format_call_args helper that builds a truncated repr of the call's args
and kwargs, printed to console and prepended to error_exception so it
propagates to RecordingLog and Slack error notifications.

Assisted-by: ClaudeCode:claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant