Put in order · NestJS course · Module 2: Routing and Request Lifecycle
Scenario: Guard Rejects a Request
Order what happens to a request when a guard rejects it, from the first stage to the last:
Items to put in order
- Guard - REJECTS request
- Exception Filter - HANDLES ForbiddenException
- Middleware - EXECUTED
- Interceptors, pipes and handler - SKIPPED
Show the answer
Correct order:
- Middleware - EXECUTED
- Guard - REJECTS request
- Interceptors, pipes and handler - SKIPPED
- Exception Filter - HANDLES ForbiddenException