Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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:
Errorclass's got anameproperty as well that can be used to identify the error type.