NestJS · Junior · Question 34 of 75

How do you return a 404 from a service or controller?

Explanation

Nest's built-in exception layer turns HttpException subclasses into JSON responses with the right status code.

Further reading

Problem with a question

NestJS · Junior · question 34

Test yourself

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

Take this quiz