class BaseWsExceptionFilter<TError = any> implements WsExceptionFilter {
protected static logger: Logger
constructor(options: BaseWsExceptionFilterOptions = {})
protected options: BaseWsExceptionFilterOptions
catch(exception: TError, host: ArgumentsHost)
handleError<TClient extends {
emit: Function;
}>(client: TClient, exception: TError, cause: { pattern: string; data: unknown; })
handleUnknownError<TClient extends {
emit: Function;
}>(exception: TError, client: TClient, data: { pattern: string; data: unknown; })
isExceptionObject(err: any): err is Error
}
Static properties
Property |
Description |
protected static logger: Logger
|
Read-only.
|
Constructor
constructor(options: BaseWsExceptionFilterOptions = {})
Parameters
Option |
Type |
Description |
options
|
BaseWsExceptionFilterOptions |
Optional. Default is {} .
|
|
Properties
Property |
Description |
protected options: BaseWsExceptionFilterOptions
|
Read-only.
Declared in constructor.
|
Methods
catch()
|
catch(exception: TError, host: ArgumentsHost)
Parameters
|
handleError()
|
handleError<TClient extends {
emit: Function;
}>(client: TClient, exception: TError, cause: { pattern: string; data: unknown; })
Parameters
Option |
Type |
Description |
client
|
TClient |
|
exception
|
TError |
|
cause
|
object |
|
|
handleUnknownError()
|
handleUnknownError<TClient extends {
emit: Function;
}>(exception: TError, client: TClient, data: { pattern: string; data: unknown; })
Parameters
Option |
Type |
Description |
exception
|
TError |
|
client
|
TClient |
|
data
|
object |
|
|
isExceptionObject()
|
isExceptionObject(err: any): err is Error
Parameters
Option |
Type |
Description |
err
|
any |
|
Returns
err is Error
|