What’s the problem you're trying to solve
We haven't had a proper way to handle errors for restful API, that is, we'll always throw "500 internal server error" for any errors.
Describe the solution you’d like
Catch these errors and set the proper HTTP status code. We can wrap our errors when they occurred and set the desired HTTP code there.
Additional context