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

Function _flushOutcomes

packages/core/src/client.ts:1573–1596  ·  view source on GitHub ↗

* Sends client reports as an envelope.

()

Source from the content-addressed store, hash-verified

1571 * Sends client reports as an envelope.
1572 */
1573 protected _flushOutcomes(): void {
1574 DEBUG_BUILD && debug.log('Flushing outcomes...');
1575
1576 const outcomes = this._clearOutcomes();
1577
1578 if (outcomes.length === 0) {
1579 DEBUG_BUILD && debug.log('No outcomes to send');
1580 return;
1581 }
1582
1583 // This is really the only place where we want to check for a DSN and only send outcomes then
1584 if (!this._dsn) {
1585 DEBUG_BUILD && debug.log('No dsn provided, will not send outcomes');
1586 return;
1587 }
1588
1589 DEBUG_BUILD && debug.log('Sending outcomes:', outcomes);
1590
1591 const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));
1592
1593 // sendEnvelope should not throw
1594 // eslint-disable-next-line @typescript-eslint/no-floating-promises
1595 this.sendEnvelope(envelope);
1596 }
1597
1598 /**
1599 * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.

Callers

nothing calls this directly

Calls 4

dsnToStringFunction · 0.90
_clearOutcomesMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected