Follow-up from "Make ResolveCtrl return specific errors depending on the resolution"
Current Issue: The FindOrCreateConsumerService likely returns error messages as strings, but the resolver now expects actual exception objects to perform pattern matching.
Required Changes:
rescue *POSSIBLE_EXCEPTIONS => e log_error('Failed to find or create consumer', extra: { error: e.message } )
Failure(e.message) # Currently returns string end
rescue *POSSIBLE_EXCEPTIONS => e log_error('Failed to find or create consumer', extra: { error: e.message } )
Failure(e) # Return the exception object instead end
Key Benefits:
- Enables proper error type matching in the resolver
- Supports specific HTTP status codes (403, 402, etc.)
- Maintains error context and type information