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);