* Sends client reports as an envelope.
()
| 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`. |
nothing calls this directly
no test coverage detected