Skip to content

Commit

Permalink
Handle error - more details
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Nov 4, 2023
1 parent c78263e commit 6b3a813
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/lib/handle-error/handle-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6b3a813

Please sign in to comment.