eventuous icon indicating copy to clipboard operation
eventuous copied to clipboard

400 Bad Request vs. 500 Internal Server Error

Open igor-toporet opened this issue 3 years ago • 1 comments

In case of an unexpected exception, I'm curious why the response status code is 400 (client error) instead of 500 (server error).

https://github.com/Eventuous/eventuous/blob/2f0415a637a4b5d163da27558bc0cec8f44c972a/src/Extensions/src/Eventuous.AspNetCore.Web/ResultExtensions.cs#L11

Is there anything that can be changed on the client side to help fix the error? I guess it's not the case.

I can imagine that there are many things on the server-side that could go wrong, e.g., interacting with network services (storage) that can suffer from intermittent connectivity errors; or simply a bug in the application code (more likely) or library code (less likely). This would justify the 500 status code, not 400, in my opinion.

Any thoughts or comments on that?

Thanks!

igor-toporet avatar May 04 '22 00:05 igor-toporet

I don't think it's possible to easily change it to be configurable, but you are totally right, it should be 500.

alexeyzimarev avatar May 04 '22 06:05 alexeyzimarev