MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / captureException

Method captureException

packages/core/src/scope.ts:690–712  ·  view source on GitHub ↗

* Capture an exception for this scope. * * @returns {string} The id of the captured Sentry event.

(exception: unknown, hint?: EventHint)

Source from the content-addressed store, hash-verified

688 * @returns {string} The id of the captured Sentry event.
689 */
690 public captureException(exception: unknown, hint?: EventHint): string {
691 const eventId = hint?.event_id || uuid4();
692
693 if (!this._client) {
694 DEBUG_BUILD && debug.warn('No client configured on scope - will not capture exception!');
695 return eventId;
696 }
697
698 const syntheticException = new Error('Sentry syntheticException');
699
700 this._client.captureException(
701 exception,
702 {
703 originalException: exception,
704 syntheticException,
705 ...hint,
706 event_id: eventId,
707 },
708 this,
709 );
710
711 return eventId;
712 }
713
714 /**
715 * Capture a message for this scope.

Callers 15

responseHandlerFunction · 0.45
handleErrorMethod · 0.45
scope.test.tsFile · 0.45
client.test.tsFile · 0.45
_processEventFunction · 0.45
captureExceptionFunction · 0.45
scope.test.tsFile · 0.45
scope.test.tsFile · 0.45
sdk.test.tsFile · 0.45
createReleaseFunction · 0.45

Calls 2

uuid4Function · 0.90
warnMethod · 0.65

Tested by

no test coverage detected