NestJS · Middle · Question 28 of 75
Why can exception filters behave differently in microservices and HTTP?
- 1Microservices ignore exceptions
- ✓Correct answer: Each transport has its own context; RPC handlers use
RpcExceptionand filters that work withhost.switchToRpc() - 3Filters work only for HTTP
Explanation
ArgumentsHost.getType() tells you the transport, so one filter can handle several types if needed.