All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.esm.utils-hoist.breadcrumb-log-level.js Maven / Gradle / Ivy

/**
 * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.
 */
function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) {
  // NOTE: undefined defaults to 'info' in Sentry
  if (statusCode === undefined) {
    return undefined;
  } else if (statusCode >= 400 && statusCode < 500) {
    return 'warning';
  } else if (statusCode >= 500) {
    return 'error';
  } else {
    return undefined;
  }
}

export { getBreadcrumbLogLevelFromHttpStatusCode };
//# sourceMappingURL=breadcrumb-log-level.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy