An exception filter catches unhandled exceptions thrown anywhere in the request pipeline — middleware, guards, interceptors, pipes, or the handler itself — and converts them into an HTTP response. The @Catch() decorator specifies which exception type(s) to intercept. Omitting it catches everything.
@Catch(HttpException) — only handles HttpException and its subclasses.
@Catch() with no argument — catches every exception including non-HTTP errors.
@Catch(NotFoundException, BadRequestException) — handles multiple types.
host.switchToHttp() provides access to req and res objects.
exception.getResponse() returns either a string or an object depending on how the exception was thrown.