Browse Source

fix: Added debug logging for api not found error

pull/6648/head
Muhammed Mustafa 11 months ago
parent
commit
37a732f7e7
  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 { Response } from 'express';
import {
@ -31,11 +31,19 @@ export class GlobalExceptionFilter implements ExceptionFilter {
exception instanceof Forbidden ||
exception instanceof NotFound ||
exception instanceof NotImplemented ||
exception instanceof UnprocessableEntity
exception instanceof UnprocessableEntity ||
exception instanceof NotFoundException
)
)
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);
if (dbError) {

Loading…
Cancel
Save