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
21 lines
565 B
Plaintext
21 lines
565 B
Plaintext
import { status as httpStatus } from 'http-status';
|
|
/**
|
|
* Determines if an error should be shown to the user.
|
|
*/ export function isErrorPublic(error, config) {
|
|
const payloadError = error;
|
|
if (config.debug) {
|
|
return true;
|
|
}
|
|
if (payloadError.isPublic === true) {
|
|
return true;
|
|
}
|
|
if (payloadError.isPublic === false) {
|
|
return false;
|
|
}
|
|
if (payloadError.status && payloadError.status !== httpStatus.INTERNAL_SERVER_ERROR) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//# sourceMappingURL=isErrorPublic.js.map |