Request.ts has a standard error processor for the back end. The server new AppError is our current standard way to fire errors back to client. We need a standard like this but to also make sure try/catch is implemented properly as well as error type that shows messages properly. For example some routes throw new AppError but there is no catch for them.
app.ts has errorHandler we need to merge AppError into this and handle errors in a proper way that is standard.
- Check request.ts and server use standard errors. 401,403,500,404,400
- Add type for Error that has message for when we use throw new AppError with a message when we do this we expect the client to render the message
- make sure when errors fire that they log in the model Error