Storz icon indicating copy to clipboard operation
Storz copied to clipboard

Fix Error Handlers and handling

Open ezehlivinus opened this issue 2 years ago • 3 comments

The error handler and how errors are handled need to be fixed.

  • The global error handler has an issue. To reproduce the error, once the server is running visit a route that does not exist, and the request will hang on until the server timeout. Example: visit: http://localhost:8080/api/user or http://localhost:8080/this-does-not-exist
  • Asynchronous errors need to be handled: currently on the route try ... catch were used to hand asynchronous errors. We can get rid of it and make the code more cleaner and maintainable. This way once can 'throw new Error' and it would be handled, also an unhandled exception would be captured. This will help us remove multiple try...catch in all the route handlers.

ezehlivinus avatar Oct 04 '22 21:10 ezehlivinus

@anomic30 please check this out and assigned it to me.

ezehlivinus avatar Oct 04 '22 21:10 ezehlivinus

@anomic30 If I am to do this, then the existing error handling code may have to move to middleware/ because that is what it is.

ezehlivinus avatar Oct 04 '22 21:10 ezehlivinus

Assigned @ezehlivinus

anomic30 avatar Oct 05 '22 14:10 anomic30