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

Function _captureEvent

packages/core/src/client.ts:1382–1409  ·  view source on GitHub ↗

* Processes the event and logs an error in case of rejection * @param event * @param hint * @param scope

(
    event: Event,
    hint: EventHint = {},
    currentScope = getCurrentScope(),
    isolationScope = getIsolationScope(),
  )

Source from the content-addressed store, hash-verified

1380 * @param scope
1381 */
1382 protected _captureEvent(
1383 event: Event,
1384 hint: EventHint = {},
1385 currentScope = getCurrentScope(),
1386 isolationScope = getIsolationScope(),
1387 ): PromiseLike<string | undefined> {
1388 if (DEBUG_BUILD && isErrorEvent(event)) {
1389 debug.log(`Captured error event \`${getPossibleEventMessages(event)[0] || '<unknown>'}\``);
1390 }
1391
1392 return this._processEvent(event, hint, currentScope, isolationScope).then(
1393 finalEvent => {
1394 return finalEvent.event_id;
1395 },
1396 reason => {
1397 if (DEBUG_BUILD) {
1398 if (_isDoNotSendEventError(reason)) {
1399 debug.log(reason.message);
1400 } else if (_isInternalError(reason)) {
1401 debug.warn(reason.message);
1402 } else {
1403 debug.warn(reason);
1404 }
1405 }
1406 return undefined;
1407 },
1408 );
1409 }
1410
1411 /**
1412 * Processes an event (either error or message) and sends it to Sentry.

Callers

nothing calls this directly

Calls 9

getCurrentScopeFunction · 0.90
getIsolationScopeFunction · 0.90
getPossibleEventMessagesFunction · 0.90
_isDoNotSendEventErrorFunction · 0.85
_isInternalErrorFunction · 0.85
isErrorEventFunction · 0.70
logMethod · 0.65
warnMethod · 0.65
thenMethod · 0.45

Tested by

no test coverage detected