Skip to content

Add error codes and doc links to registry errors#399

Open
flossypurse wants to merge 1 commit intomainfrom
fix/registry-error-codes
Open

Add error codes and doc links to registry errors#399
flossypurse wants to merge 1 commit intomainfrom
fix/registry-error-codes

Conversation

@flossypurse
Copy link
Contributor

Summary

  • Add ResonateRegistryError exception class with error codes (1000-1003) and documentation links matching the error docs
  • Update registry.py to raise ResonateRegistryError instead of plain ValueError for registry-specific errors
  • Handle function-not-found gracefully in bridge: catch ResonateRegistryError in _process_msgs, log the error, and drop the task instead of crashing the process via os._exit(1)
  • ResonateRegistryError extends both ResonateError and ValueError for backward compatibility with existing except ValueError handlers

Error codes added

Code Name Description
1000 REGISTRY_VERSION_INVALID Function version must be greater than zero
1001 REGISTRY_NAME_REQUIRED Function name is required
1002 REGISTRY_FUNCTION_ALREADY_REGISTERED Function already registered
1003 REGISTRY_FUNCTION_NOT_REGISTERED Function not registered (will drop)

Error output example

[1003] REGISTRY_FUNCTION_NOT_REGISTERED. Function 'game' is not registered. Will drop. (See https://docs.resonatehq.io/debug/errors#1003 for more information)

This is part of the composite debugging/developer UX improvement tracked in resonatehq/resonatehq-workq#6.

Resolves #336

Related PRs

  • Server: resonatehq/resonate (fix/error-codes-and-urls)
  • Docs: resonatehq/docs.resonatehq.io (fix/error-codes-docs)

Test plan

  • All 228,236 tests pass (pytest tests/test_resonate.py)
  • Verify function-not-found no longer causes process exit
  • Verify error output includes code and documentation link

🤖 Generated with Claude Code

- Add ResonateRegistryError with error codes (1000-1003) and doc links
- Update registry.py to raise ResonateRegistryError instead of ValueError
- Handle function-not-found gracefully in bridge: log and drop task instead
  of crashing the process via os._exit(1)
- ResonateRegistryError extends both ResonateError and ValueError for
  backward compatibility

Refs: resonatehq/resonatehq-workq#6, #336

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Update exception message to include an error code and link.

1 participant