The below snippet is copied from a comment on the PR: #191 that was not resolved yet.
If I am not mistaken, we could create our own error, such as ApiError and throw these in our endpoints.
Then, it should be automatically passed to an error handler. So instead of doing
err.shouldReload = true;
err.status = 400;
next(err);
We could do something like:
throw new ApiError()
and then we handle it in an error handler.
The below snippet is copied from a comment on the PR: #191 that was not resolved yet.
If I am not mistaken, we could create our own error, such as ApiError and throw these in our endpoints.
Then, it should be automatically passed to an error handler. So instead of doing
We could do something like:
throw new ApiError()and then we handle it in an error handler.