Skip to content

Conversation

@VegetarianOrc
Copy link
Collaborator

@VegetarianOrc VegetarianOrc commented Jan 6, 2026

Summary

  • Preserve the raw error type string when HandlerError is created with string error types
  • Refactor implementation to use direct attributes instead of properties where appropriate

Changes

  • Added raw_error_type attribute to HandlerError to preserve the original string value
  • Changed HandlerError constructor parameter from type to error_type and allow both HandlerErrorType | str
  • Added UNKNOWN error type to HandlerErrorType enum for unrecognized string types
  • Use match statement to check retry-ability
  • Replaced property-based access with direct attribute access (error_type, retryable_override)
  • Added logging warning when unknown string error types are encountered
  • Updated all HandlerError usage throughout the codebase to use error_type parameter

How Was This Tested?

  • Updated existing tests to verify raw error type preservation
  • Added test for unknown string error types

- Make raw_error_type optional in constructor, defaults to error_type.value
- Preserve raw_error_type separately to handle unknown types from the wire
- Remove unnecessary retryable_override property wrapper
- Update docstring examples to show from_error_type() as primary API
- Update usages to use from_error_type()
- Enhance tests with explicit assertions for error_type and raw_error_type
@VegetarianOrc VegetarianOrc requested a review from a team as a code owner January 6, 2026 00:17
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