From 933be8c3f58e4e6a92b9e8c85fe065e6e9e4fdb7 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 20 May 2024 21:41:46 +0530 Subject: [PATCH] fix: unnecessary error logs (#8527) * fix: unnecessary error logs * fix: reverse condition to improve readability Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: mertmit Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../src/filters/global-exception/global-exception.filter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/filters/global-exception/global-exception.filter.ts b/packages/nocodb/src/filters/global-exception/global-exception.filter.ts index 9f50b884a2..f3e275c0c4 100644 --- a/packages/nocodb/src/filters/global-exception/global-exception.filter.ts +++ b/packages/nocodb/src/filters/global-exception/global-exception.filter.ts @@ -10,6 +10,7 @@ import { ExternalError, extractDBError, Forbidden, + NcBaseError, NcBaseErrorv2, NotFound, SsoError, @@ -39,7 +40,8 @@ export class GlobalExceptionFilter implements ExceptionFilter { exception = new NcBaseErrorv2(NcErrorType.BAD_JSON); } - const dbError = extractDBError(exception); + // try to extract db error for unknown errors + const dbError = !(exception instanceof NcBaseError) ? extractDBError(exception) : null; // skip unnecessary error logging if (