How to use the @sentry/types.Severity.Error 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 / integrations / globalhandlers.ts View on Github external
if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {
        if (self._oldOnUnhandledRejectionHandler) {
          return self._oldOnUnhandledRejectionHandler.apply(this, arguments);
        }
        return true;
      }

      const client = currentHub.getClient();
      const event = isPrimitive(error)
        ? self._eventFromIncompleteRejection(error)
        : eventFromUnknownInput(error, undefined, {
            attachStacktrace: client && client.getOptions().attachStacktrace,
            rejection: true,
          });

      event.level = Severity.Error;

      addExceptionMechanism(event, {
        handled: false,
        type: 'onunhandledrejection',
      });

      currentHub.captureEvent(event, {
        originalException: error,
      });

      if (self._oldOnUnhandledRejectionHandler) {
        return self._oldOnUnhandledRejectionHandler.apply(this, arguments);
      }

      return true;
    };
github getsentry / sentry-javascript / packages / browser / src / backend.ts View on Github external
public eventFromException(exception: any, hint?: EventHint): PromiseLike {
    const syntheticException = (hint && hint.syntheticException) || undefined;
    const event = eventFromUnknownInput(exception, syntheticException, {
      attachStacktrace: this._options.attachStacktrace,
    });
    addExceptionMechanism(event, {
      handled: true,
      type: 'generic',
    });
    event.level = Severity.Error;
    if (hint && hint.event_id) {
      event.event_id = hint.event_id;
    }
    return SyncPromise.resolve(event);
  }
  /**
github getsentry / sentry-javascript / packages / browser / src / integrations / instrumenthandlers.ts View on Github external
handlerData.fetchData.url.indexOf(filterUrl) !== -1 &&
      handlerData.fetchData.method === 'POST' &&
      handlerData.args[1] &&
      handlerData.args[1].body
    ) {
      addSentryBreadcrumb(handlerData.args[1].body);
      return;
    }
  }

  if (handlerData.error) {
    getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data: handlerData.fetchData,
        level: Severity.Error,
        type: 'http',
      },
      {
        data: handlerData.error,
        input: handlerData.args,
      },
    );
  } else {
    getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data: handlerData.fetchData,
        type: 'http',
      },
      {
        input: handlerData.args,
github getsentry / sentry-javascript / packages / node / src / integrations / console.ts View on Github external
fill(originalModule, level, function(originalConsoleLevel: () => any): any {
      let sentryLevel: Severity;

      switch (level) {
        case 'debug':
          sentryLevel = Severity.Debug;
          break;
        case 'error':
          sentryLevel = Severity.Error;
          break;
        case 'info':
          sentryLevel = Severity.Info;
          break;
        case 'warn':
          sentryLevel = Severity.Warning;
          break;
        default:
          sentryLevel = Severity.Log;
      }

      return function(): any {
        if (getCurrentHub().getIntegration(Console)) {
          getCurrentHub().addBreadcrumb(
            {
              category: 'console',