Browse Source

Merge pull request #6648 from nocodb/nc-fix/add-jwt-auth-log-at-debug-level

Added debug logging for api not found error
pull/6650/head
Pranav C 11 months ago committed by GitHub
parent
commit
beac56c18a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/nocodb/src/filters/global-exception/global-exception.filter.ts

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

@ -1,4 +1,4 @@
import { Catch, Logger } from '@nestjs/common'; import { Catch, Logger, NotFoundException } from '@nestjs/common';
import type { ArgumentsHost, ExceptionFilter } from '@nestjs/common'; import type { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
import type { Response } from 'express'; import type { Response } from 'express';
import { import {
@ -31,11 +31,19 @@ export class GlobalExceptionFilter implements ExceptionFilter {
exception instanceof Forbidden || exception instanceof Forbidden ||
exception instanceof NotFound || exception instanceof NotFound ||
exception instanceof NotImplemented || exception instanceof NotImplemented ||
exception instanceof UnprocessableEntity exception instanceof UnprocessableEntity ||
exception instanceof NotFoundException
) )
) )
this.logger.error(exception.message, exception.stack); this.logger.error(exception.message, exception.stack);
// API not found
if (exception instanceof NotFoundException) {
this.logger.debug(exception.message, exception.stack);
return response.status(404).json({ msg: exception.message });
}
const dbError = extractDBError(exception); const dbError = extractDBError(exception);
if (dbError) { if (dbError) {

Loading…
Cancel
Save