Skip to content

ref(browser): Set more descriptive mechanism.type in browserApiErrorsIntergation #17251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/browser/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function wrap<T extends WrappableFunction, NonFunction>(
return event;
});

// no need to add a mechanism here, we already add it via an event processor above
Copy link
Member Author

@Lms24 Lms24 Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap is only called by browserApiErrors, where I changed type below.

captureException(ex);
});

Expand Down
10 changes: 5 additions & 5 deletions packages/browser/src/integrations/browserapierrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function _wrapTimeFunction(original: () => void): () => number {
mechanism: {
data: { function: getFunctionName(original) },
handled: false,
type: 'instrument',
type: 'browserApiErrors',
},
});
return original.apply(this, args);
Expand All @@ -127,7 +127,7 @@ function _wrapRAF(original: () => void): (callback: () => void) => unknown {
handler: getFunctionName(original),
},
handled: false,
type: 'instrument',
type: 'browserApiErrors',
},
}),
]);
Expand All @@ -150,7 +150,7 @@ function _wrapXHR(originalSend: () => void): () => void {
handler: getFunctionName(original),
},
handled: false,
type: 'instrument',
type: 'browserApiErrors',
},
};

Expand Down Expand Up @@ -199,7 +199,7 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp
target,
},
handled: false,
type: 'instrument',
type: 'browserApiErrors',
},
});
}
Expand All @@ -221,7 +221,7 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp
target,
},
handled: false,
type: 'instrument',
type: 'browserApiErrors',
},
}),
options,
Expand Down
Loading