mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Merge branch '11.0.0' into chore/eslint-v9
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import { ArgumentsHost, Logger, RpcExceptionFilter } from '@nestjs/common';
|
||||
|
||||
/* eslint-disable prefer-spread */
|
||||
import {
|
||||
ArgumentsHost,
|
||||
IntrinsicException,
|
||||
Logger,
|
||||
RpcExceptionFilter,
|
||||
} from '@nestjs/common';
|
||||
import { isObject } from '@nestjs/common/utils/shared.utils';
|
||||
import { MESSAGES } from '@nestjs/core/constants';
|
||||
import { Observable, throwError as _throw } from 'rxjs';
|
||||
@@ -25,8 +32,10 @@ export class BaseRpcExceptionFilter<T = any, R = any>
|
||||
public handleUnknownError(exception: T, status: string) {
|
||||
const errorMessage = MESSAGES.UNKNOWN_EXCEPTION_MESSAGE;
|
||||
|
||||
const logger = BaseRpcExceptionFilter.logger;
|
||||
logger.error.apply(logger, [exception]);
|
||||
if (!(exception instanceof IntrinsicException)) {
|
||||
const logger = BaseRpcExceptionFilter.logger;
|
||||
logger.error(exception);
|
||||
}
|
||||
|
||||
return _throw(() => ({ status, message: errorMessage }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user