NestJS · Middle · Question 26 of 75

How do you write a global filter that formats all errors as RFC 9457 problem details?

Explanation

Map HttpExceptions to their status, unknown errors to 500 with a generic message, and log the real error with a request ID.

Further reading

Problem with a question

NestJS · Middle · question 26

Test yourself

Take the NestJS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz