-
Notifications
You must be signed in to change notification settings - Fork 115
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
The second argument "Error" overwrites the first argument "status" #58
Comments
So there seems to be a lot of opinions on this and we are trying to change this as people want. For example there is an open PR #37 that goes in the opposite direction you want, using the status from even non Error objects. So I'm not sure what the right answer here is, as it seems like everyone wants it to work a different way. The way it is now was also a pull request to make it take the error from the given Error object and ignore the number argument. Because of this, I don't really want to change the behavior as there will certainly be folks who arrive saying the behavior you want here is unexpected/wrong too (this actually happened and is why we have the behavior we have now). Do you have a solution that will satisfy all these requests vs just keep changing the behavior with each request? That would be awesome. |
Thank you very much for your reply. I understood that the phenomenon is not a bug but the will of the project. I am using
I was blind to this code. And now, I am going to change this to make the source code work as I want.
I am sorry, but I do not have enough knowledge to answer clearly.
However, I found the following code and I was worried that it might be dangerous. Line 68 in c69cac7
And I decided not to adopt that idea ... If PR #37 is included in Thank you =) |
I am sorry if I had written rude things because I am poor at English.
When I specified
Error
as the second argument, there was a key likestatus
orstatusCode
, so the status code of the first argument was overwritten.Error is like this.
And, I written the following code.
In the case of the above error, the first argument is ignored and the return value of status is forced to 400.
And I return the status of the Error to the client, as the status code of the response.
This is caused by the following code.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think it's strange that
status
was changed by the first argument , but it will changed again.The text was updated successfully, but these errors were encountered: