How to return error messages to client? #1208
Unanswered
awatson1978
asked this question in
Q&A
Replies: 1 comment
-
What you could do for this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Neither a bug nor a feature request (yet), just trying to figure out the recommended approach to returning an error message to the client.
When I try to log in using an incorrect password, I can generate an
AccountsJsError
easily enough, and I see theInvalid credentials
message in the server console.However, when I try to catch the error on the client, I'm getting a TypeError, because the
accounts/password/authenticate
endpoint isn't returning a proper payload.Here is my code.
Should I be using a specific HTTP message code? Does the error get put into the body of the response? In the header? Something else?
Any guidance on how to wire this up correctly would be much appreciated!
-aw
Beta Was this translation helpful? Give feedback.
All reactions