-
Notifications
You must be signed in to change notification settings - Fork 1
Allow any object with respond_with_error #39
Copy link
Copy link
Closed
Description
Rubyists::Leopard::MessageWrapper#respond_with_error converts its argument to a string before passing to nats-pure.
nats-pure wraps that arument with NATS::Service::ErrorWrapper, which then passes it through a case statement of Exception, Hash, ErrorWrapper, or else. else converts the error to string and sets the code to 500. If we want to build our own response to have a different code, for example 422, we would call something like Dry::Monads::Failure({ description: 'an error', code: 422 }). This gets converted to a string and the code is set to 500.
Desired behavior is for Rubyists::Leopard::MessageWrapper#respond_with_error to pass its argument without any typecasting.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels