Is there any way to catch the value of what caused an exception to be thrown? I'm currently using a Nest global exception filter that catches just about everything (a very basic one, identical to the one on Nest's documentation) and to show custom messages, I'm doing something like:
catch(exception, host) {
if(exception instanceof AnyErrorObjectHere) {
// log a custom message
}
}
What if I want to know what caused that issue? If I tried to send an invalid value to my ORM or if I tried to parse something not parsable... Do my exception holds that value?
Have you tried this?:
exception?.message
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error