Updating logging to typescript to fix build issue.
This commit is contained in:
parent
85cb766d14
commit
3cc8b7d4a9
|
@ -1,10 +1,10 @@
|
||||||
const NonErrors = ["AccountError"]
|
const NonErrors = ["AccountError"]
|
||||||
|
|
||||||
function isSuppressed(e) {
|
function isSuppressed(e?: any) {
|
||||||
return e && e["suppressAlert"]
|
return e && e["suppressAlert"]
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.logAlert = (message, e = null) => {
|
export function logAlert(message: string, e?: any) {
|
||||||
if (e && NonErrors.includes(e.name) && isSuppressed(e)) {
|
if (e && NonErrors.includes(e.name) && isSuppressed(e)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -14,3 +14,7 @@ module.exports.logAlert = (message, e = null) => {
|
||||||
}
|
}
|
||||||
console.error(`bb-alert: ${message} ${errorJson}`)
|
console.error(`bb-alert: ${message} ${errorJson}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
logAlert,
|
||||||
|
}
|
Loading…
Reference in New Issue