-
Notifications
You must be signed in to change notification settings - Fork 1
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
status code is not provided when InvalidResponseError is obtained #20
Comments
Hi @AlvaroVega! Thanks for reporting this. I think adding the status code to the InvalidRequestError exception would be a great addition as usually this error is raised as the response status code is not one of the expected ones. In addition, we are going to provide also the body of the response. Both details should provide a good way to check what the problem is. That said, I was thinking about the 401 error code, and I think that error response should not be managed with the InvalidRequestError. So we are working on adding an UnauthorizedError exception for those cases as well as an ForbiddenError exception for the 403 status code. What do you think? |
Absolutely, 401 and UnauthorizedError and 403 with ForbiddenError . |
Cloned from conwetlab#54
status code is not provided when InvalidResponseError is obtained
https://github.com/conwetlab/ngsijs/blob/59ce53e2cfd7b486aa9580cbbc74dc339b134af2/dist/NGSI.js#L1687-L1691
InvalidResponseError could happens for example when PEP responses 401
Not sure if is really a bug or maybe just something that could be improved.
Others errors like InvalidRequestError are providing status code:
https://github.com/conwetlab/ngsijs/blob/59ce53e2cfd7b486aa9580cbbc74dc339b134af2/dist/NGSI.js#L1624-L1629
The text was updated successfully, but these errors were encountered: