Browse Source

Merge pull request #6625 from nocodb/nc-fix/at-import

refactor: Avoid unnecessary error logging
pull/6630/head
Pranav C 1 year ago committed by GitHub
parent
commit
b627ce4b2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      packages/nocodb/src/filters/global-exception/global-exception.filter.ts

15
packages/nocodb/src/filters/global-exception/global-exception.filter.ts

@ -21,7 +21,20 @@ export class GlobalExceptionFilter implements ExceptionFilter {
const ctx = host.switchToHttp(); const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>(); const response = ctx.getResponse<Response>();
this.logger.error(exception.message, exception.stack); // skip unnecessary error logging
if (
process.env.NC_ENABLE_ALL_API_ERROR_LOGGING === 'true' ||
!(
exception instanceof BadRequest ||
exception instanceof AjvError ||
exception instanceof Unauthorized ||
exception instanceof Forbidden ||
exception instanceof NotFound ||
exception instanceof NotImplemented ||
exception instanceof UnprocessableEntity
)
)
this.logger.error(exception.message, exception.stack);
const dbError = extractDBError(exception); const dbError = extractDBError(exception);

Loading…
Cancel
Save