Skip to content

Commit 83481af

Browse files
Merge pull request #750 from st3iny/feat/capture-whole-error-object
feat: capture whole error objects
2 parents 6e29c63 + da595c0 commit 83481af

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/init.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ import { loadState } from '@nextcloud/initial-state'
2828

2929
import Logger from './logger'
3030

31+
const attachErrorIntegration = {
32+
name: 'AttachErrorIntegration',
33+
processEvent(event, hint, client) {
34+
if (hint.originalException) {
35+
event.extra ??= {}
36+
event.extra['error'] = hint.originalException
37+
}
38+
return event
39+
},
40+
}
41+
3142
try {
3243
const dsn = loadState('sentry', 'dsn')
3344

@@ -36,6 +47,9 @@ try {
3647
} else {
3748
const config = {
3849
dsn,
50+
integrations: [
51+
attachErrorIntegration,
52+
],
3953
}
4054

4155
if (typeof OC.config.version !== 'undefined') {

0 commit comments

Comments
 (0)