Skip to content

Commit 08ca466

Browse files
committed
chore: if error contains cause prop log that error instead
Drizzle burries the underlying error in the cause property of the error object.
1 parent af74323 commit 08ca466

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/web/src/helpers/captureException.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export const captureException = (error: Error, tags?: Record<string, any>) => {
66
console.error('Captured exception:', error)
77
}
88

9+
if ('cause' in error) {
10+
captureException(error.cause as Error, tags)
11+
return
12+
}
13+
914
// Add error information to the current span
1015
const span = tracer.scope().active()
1116
if (span) {

0 commit comments

Comments
 (0)