UNPKG

657 BTypeScriptView Raw
1import { Observable } from 'rxjs';
2import { ArgumentsHost } from '../features/arguments-host.interface';
3/**
4 * Interface describing implementation of an RPC exception filter.
5 *
6 * @see [Exception Filters](https://docs.nestjs.com/microservices/exception-filters)
7 *
8 * @publicApi
9 */
10export interface RpcExceptionFilter<T = any, R = any> {
11 /**
12 * Method to implement a custom (microservice) exception filter.
13 *
14 * @param exception the type (class) of the exception being handled
15 * @param host used to access an array of arguments for
16 * the in-flight message
17 */
18 catch(exception: T, host: ArgumentsHost): Observable<R>;
19}