davidbanham / express-async-errors

async/await support for ExpressJS
Other
891 stars 42 forks source link

Avoid logging catched errors #44

Closed ManuLpz4 closed 1 year ago

ManuLpz4 commented 1 year ago

Hey, guys! How is it going? Do you know any way to avoid logging all the catched errors? It's a bit dirty in my honest opinion :(

Captura de Pantalla 2022-12-30 a la(s) 22 47 32
damir-bajramovic commented 1 year ago

@ManuLpz4 Are you sure you're not explicitly logging the error in your middleware? I don't get those logs unless I explicitly call console.error from my middleware.

Another caveat is, your global exception-handling middleware should be the last middleware in your middleware chain. Could you try something like shown in the image? image

ManuLpz4 commented 1 year ago

@ManuLpz4 Are you sure you're not explicitly logging the error in your middleware? I don't get those logs unless I explicitly call console.error from my middleware.

Another caveat is, your global exception-handling middleware should be the last middleware in your middleware chain. Could you try something like shown in the image?

image

I come to my house, try it and answer. Thank you for taking the time to helping me

damir-bajramovic commented 1 year ago

@ManuLpz4 You're welcome! Please, do tell if it works. I had the issue myself.

ManuLpz4 commented 1 year ago

Fixed! Thank you so much Dam for helping me :)

I think the issue was the lack of a handler, my bad, im burnout