API Reference
Rockets Core API
nestjs-logger
classes
LoggerExceptionFilter

Class: LoggerExceptionFilter

The Logger Exception Filter Class

Out of the box, this action is performed by a built-in global exception filter, which handles exceptions of type HttpException

Extends

  • BaseExceptionFilter

Constructors

new LoggerExceptionFilter()

new LoggerExceptionFilter(loggerService): LoggerExceptionFilter

Constructor

Parameters

ParameterTypeDescription
loggerServiceLoggerServiceinstance of the Logger Service

Returns

LoggerExceptionFilter

Overrides

BaseExceptionFilter.constructor

Defined in

packages/nestjs-logger/src/logger-exception.filter.ts:21 (opens in a new tab)

Properties

PropertyModifierTypeInherited from
applicationRef?readonlyHttpServer<any, any>BaseExceptionFilter.applicationRef
httpAdapterHost?readonlyHttpAdapterHost<AbstractHttpAdapter<any, any, any>>BaseExceptionFilter.httpAdapterHost

Methods

catch()

catch(exception, host): void

Override catch to log before returning exception.

Parameters

ParameterTypeDescription
exceptionErrorError instance
hostArgumentsHostArguments Host instance

Returns

void

Overrides

BaseExceptionFilter.catch

Defined in

packages/nestjs-logger/src/logger-exception.filter.ts:34 (opens in a new tab)


handleUnknownError()

handleUnknownError(exception, host, applicationRef): void

Parameters

ParameterType
exceptionany
hostArgumentsHost
applicationRefHttpServer<any, any> | AbstractHttpAdapter<any, any, any>

Returns

void

Inherited from

BaseExceptionFilter.handleUnknownError

Defined in

node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts:10


isExceptionObject()

isExceptionObject(err): err is Error

Parameters

ParameterType
errany

Returns

err is Error

Inherited from

BaseExceptionFilter.isExceptionObject

Defined in

node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts:11


isHttpError()

isHttpError(err): err is Object

Checks if the thrown error comes from the "http-errors" library.

Parameters

ParameterTypeDescription
erranyerror object

Returns

err is Object

Inherited from

BaseExceptionFilter.isHttpError

Defined in

node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts:16