-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operation validation errors don't get reported to client properly #101
Comments
Same thing applies to abort! and failed { }
In the promise I receive an object with class Hyperstack::Operation::Exit
Hyperstack::ControllerOp responds with code 500 the promise receives plain Exception with the message {"error":"Hyperstack::Operation::Exit"}
Hyperstack::ControllerOp responds with code 500 and the promise receives plain Exception with the message {"error"=>"some description"} |
@psmir so just to confirm... the big problem here is that you resulting error type does not match the message type you got on the client? |
@catmando Yes
|
I think Validation errors should be a 400, authentication errors be a 403, and all other errors should stay as 500 errors:
|
Thank you for the fix. I have tested it and found out that some inconsistencies are still there.
|
@catmando Can you look at my comment above, please? |
@psmir thanks for making this clear. I'll have a chance to work on this once I get this Rails Conf presentation sent in. |
fixed hyperstack-org#101 when ServerOp transmits errors to the client
fixed hyperstack-org#101 when ServerOp transmits errors to the client
reported by @psmir
When client side validation fails my promise receives the convenient Hyperstack::Operation::ValidationException. But when server side validation fails it receives plain Exception and I can't get errors hash from it. Moreover the server responds with code 500.
Is it possible to make Hyperstack to raise Hyperstack::Operation::ValidationException on the client side when server validation fails and not to respond with code 500 ?
The text was updated successfully, but these errors were encountered: