Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
19 lines
544 B
Plaintext
19 lines
544 B
Plaintext
/**
|
|
* 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
|