Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
How to catch value that caused exception

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?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Have you tried this?:

exception?.message

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!