-
Notifications
You must be signed in to change notification settings - Fork 301
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
Map error codes from The Things Join Server #7045
Milestone
Comments
Hi @johanstokking , Can you please provide more details? What do you think, where should we map the error codes? There is already a mapping here
Do you think we should change the mapping here? e.g http.StatusForbidden -> errBadRequest |
Yes exactly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The Things Join Server returns various error codes which The Things Stack should understand better to improve the user experience.
Current Situation
Currently, when the device's claim authentication code (owner token) is wrong, TTJS returns 403 that is passed through to the client (Console), which suggests the user to sign-in again. Instead, this occassion should be mapped to 500 because it is bad configuration.
Why do we need this? Who uses it, and when?
We need not to confuse users to sign in again if server-to-server authentication failed or if a claim code is wrong.
Proposed Implementation
TTJS returns:
I.e. TTS cannot simply map a status code to another one, as some are reused (as they should be). Most notably, the last 403 is relevant to the end user, while the others are all bad config and should return 500.
The only way to implement this is to test the error message that TTJS returns. If it is 403 and the message is
claim failed with given owner token
, it should be mapped to 400 (Bad request) and the others should be 500 (Internal server error).Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: