Skip to content

Improve error handling for missing object tag in connect_timelapse#125

Draft
arjunrajlab wants to merge 2 commits intomasterfrom
claude/timelapse-worker-tags-error-BAs7r
Draft

Improve error handling for missing object tag in connect_timelapse#125
arjunrajlab wants to merge 2 commits intomasterfrom
claude/timelapse-worker-tags-error-BAs7r

Conversation

@arjunrajlab
Copy link
Collaborator

Summary

Improved error handling in the connect_timelapse worker to gracefully handle missing or invalid object tags instead of raising exceptions. The worker now sends a user-friendly error message and returns early without proceeding with annotation processing.

Key Changes

  • Early validation: Added explicit check for object_tag before attempting to use it, with clear error messaging
  • Better error messages: Enhanced sendError call to include an info parameter with actionable guidance for users
  • Graceful failure: Changed from raising ValueError to calling sendError and returning, allowing the worker to fail gracefully
  • Comprehensive test coverage: Added three new test cases covering different scenarios:
    • Empty list for object tag
    • None value for object tag
    • Missing Object to connect tag key entirely

Implementation Details

  • The validation now occurs immediately after extracting the object_tag from workerInterface
  • All three failure modes (empty list, None, missing key) are handled by the same validation logic
  • Tests verify that sendError is called with appropriate messaging and that downstream operations (like getAnnotationsByDatasetId) are not executed
  • The error message guides users to specify the required parameter in the worker interface configuration

https://claude.ai/code/session_01GRr1rfjTWiPomHhCzy8NZG

Check for missing/empty tags before attempting to convert to set,
preventing TypeError when tags are None. Use sendError with info
message and return gracefully instead of raising an exception.

https://claude.ai/code/session_01GRr1rfjTWiPomHhCzy8NZG
- Replace old test that expected ValueError with three new tests
- Test empty list, None, and missing key scenarios
- Verify sendError is called with correct message and info
- Verify worker returns early without fetching annotations

https://claude.ai/code/session_01GRr1rfjTWiPomHhCzy8NZG
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.

2 participants