-
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
dcs: Remap error codes from TTJS #7143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johanstokking you are right, I will change it to check the error message. Is the error message |
It comes from here: https://github.com/TheThingsIndustries/lorawan-join-server/blob/master/src/core/controller.ts#L486-L488. The response will be a JSON message A small nit comment is that |
@johanstokking thank you for clarifying what is the join server and where the error comes from. Now it make more sense. I agree to name an internal server error as |
@halimi: For future reference, we don't use |
Understood, I will keep in mind, thank you. |
Summary
Closes #7045
HTTP error codes coming from the JS passed through to the client. These error codes are not relevant to the clients and sometimes they are confusing e.g. wrong owner token results 403 forbidden but it should be just 400 bad request. To not confuse the client we remapped some of the error codes.
Changes
This change remaps the error code from TTJS.
Testing
Steps
Try to register a device with a wrong authentication code and you should get error 400 bad request instead of 403 forbidden.
Results
Registering a device with wrong authentication code results error code 400.
Regressions
Some of the error codes have been changed.
Notes for Reviewers
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.