-
Notifications
You must be signed in to change notification settings - Fork 352
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
Return the proper status codes from the WebAPI #593
Comments
I can work on it. |
That'd be great. Do you know where to look at or do you need any guidance? |
@XVincentX |
Correct. One example would be here |
@XVincentX please assign me |
Go for it @iwko |
@XVincentX I went through |
@iwko Not exactly that. https://github.com/ExpressGateway/express-gateway/blob/master/lib/rest/routes/users.js#L8-L17 You can see here that, in case the schema validation fails, a generic error is returned using Does that clarify the issue? |
Okay, now I've got the point |
If you need any clarification or help feel free to write me. There are some parts that might need to be refactored in order to make that happen; I can take care of those eventually. |
@XVincentX I think I'm gonna pass on this issue. I've tried to figure out these codes but I am not sure which methods should have statuses added |
That makes sense — it might be a bit complicated and tiring to do that. I'll handle it. Thanks anyway! |
If not for some particular exceptions, the status code returned from our WebAPI on error is always 500, regardless of the kind of error.
If an object already exists, for example, it should be returned as
409
. If the object does not pass the schema validation, it should be a415
.Go through the whole WebAPI and verify that the status codes are being returned correctly.
Hint:
Error
class's got aname
property as well that can be used to identify the error type.The text was updated successfully, but these errors were encountered: