Skip to content

Preserve Raw Error Type in Nexus Handler Errors#1265

Closed
VegetarianOrc wants to merge 1 commit intomainfrom
nexus-raw-error-type
Closed

Preserve Raw Error Type in Nexus Handler Errors#1265
VegetarianOrc wants to merge 1 commit intomainfrom
nexus-raw-error-type

Conversation

@VegetarianOrc
Copy link
Contributor

Update to nexus-rpc that allows creating nexusrpc.HandlerError from an error type string. Refactor converter to use the string constructor rather than determining the nexusrpc.HandlerErrorType. Update references to nexusrpc.HandlerError to use the renamed error_type field.

What was changed

  • Renamed all references from HandlerError.type to HandlerError.error_type throughout
  • Refactored DefaultFailureConverter.from_failure() in temporalio/converter.py:1186-1199 to construct nexusrpc.HandlerError directly from error type strings instead of converting to HandlerErrorType enum
  • Removed the try/except logic that handled unknown HandlerErrorType values with fallback to INTERNAL

Why?

The nexus-rpc library now supports creating HandlerError instances directly from error type strings rather than requiring enum values. This change:

  • Simplifies error handling by eliminating the need for string-to-enum conversion
  • Removes special handling for unknown error types (no more KeyError catching and logging)
  • Provides better forward compatibility - new error types added by the server won't cause issues in the client
  • Aligns with upstream nexus-rpc API changes where the field was renamed from type to error_type

Checklist

How was this tested

  • Used existing tests to confirm no behavioral changes

…n error type string. Refactor converter to use the string constructor rather than determining the nexusrpc.HandlerErrorType. Update references to nexusrpc.HandlerError to use the renamed error_type field.
@cretz
Copy link
Member

cretz commented Feb 2, 2026

@VegetarianOrc - can you also delete the branches associated w/ these PRs that are being closed?

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