How to use the @sentry/types.Status.Failed function in @sentry/types

To help you get started, we’ve selected a few @sentry/types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getsentry / sentry-javascript / packages / browser / src / transports / beacon.ts View on Github external
public async sendEvent(event: Event): Promise {
    const result = global.navigator.sendBeacon(this.url, JSON.stringify(event));

    return this._buffer.add(
      Promise.resolve({
        status: result ? Status.Success : Status.Failed,
      }),
    );
  }
}