Skip to content

Conversation

@refcell
Copy link
Owner

@refcell refcell commented Feb 1, 2026

Summary

  • Adds BACKEND_TIMEOUT error code constant (-32011) to the error_codes module
  • Adds explicit BackendTimeout match arm in to_error_payload() instead of falling through to internal_error()
  • Uses inline format args for consistency with modern Rust style
  • Adds test coverage for BackendTimeout error code and payload message content

Changes

Previously, BackendTimeout errors fell through to internal_error() in to_error_payload(), returning a generic -32603 code. Now it returns a specific -32011 timeout error code with a descriptive message containing the backend name.

This improves client-side error handling by allowing callers to distinguish timeout errors from other internal errors.

Testing

  • Added test case for BackendTimeout in test_error_payload_code
  • Added test_backend_timeout_payload_contains_name test to verify message content
  • All 24 tests pass

- Add BACKEND_TIMEOUT error code constant (-32011) to error_codes module
- Add explicit BackendTimeout match arm in to_error_payload()
- Use inline format args for consistency
- Add test coverage for BackendTimeout error code and payload message
@refcell
Copy link
Owner Author

refcell commented Feb 1, 2026

Review: ✅ LGTM

Clean implementation:

  • Error code -32011 follows existing pattern with BACKEND_OFFLINE at -32010
  • Explicit BackendTimeout match arm is cleaner than falling through to internal_error()
  • Good test coverage added
  • Inline format args are consistent with modern Rust style

Verified:

  • ✅ Clippy clean
  • ✅ All tests pass

@refcell refcell merged commit aa0d4ca into main Feb 1, 2026
15 of 17 checks passed
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