From 6b3a8130705443367a99fc3ebadc3d879dececaf Mon Sep 17 00:00:00 2001 From: Gorbachev Egor <7gorbachevm@gmail.com> Date: Sat, 4 Nov 2023 12:37:41 +0700 Subject: [PATCH] Handle error - more details --- functions/lib/handle-error/handle-error.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/lib/handle-error/handle-error.ts b/functions/lib/handle-error/handle-error.ts index 5945fc1a..9cdbf317 100644 --- a/functions/lib/handle-error/handle-error.ts +++ b/functions/lib/handle-error/handle-error.ts @@ -17,9 +17,9 @@ const reportErrorToTelegram = (error: unknown, env: unknown) => { message: (error as Error)?.message, name: (error as Error)?.name, stack: (error as Error)?.stack, - isDatabaseException: error && error instanceof DatabaseException, - isZodError: error && error instanceof ZodError, - ...Object.getOwnPropertyNames(error), + databaseException: error && error instanceof DatabaseException ? error.error : null, + zodError: error && error instanceof ZodError ? error.issues : null, + error: JSON.stringify(error, null, 2) } const bot = new Bot(envSafe.data.BOT_ERROR_REPORTING_TOKEN);