mirror of https://github.com/Budibase/budibase.git
Browse Source
Graceful server shutdown and cleaning up hooks which keep instance alivepull/6159/head
committed by
GitHub
11 changed files with 119 additions and 15 deletions
@ -0,0 +1 @@ |
|||||
|
module.exports = require("./src/logging") |
||||
@ -0,0 +1,16 @@ |
|||||
|
const NonErrors = ["AccountError"] |
||||
|
|
||||
|
function isSuppressed(e) { |
||||
|
return e && e["suppressAlert"] |
||||
|
} |
||||
|
|
||||
|
module.exports.logAlert = (message, e = null) => { |
||||
|
if (e && NonErrors.includes(e.name) && isSuppressed(e)) { |
||||
|
return |
||||
|
} |
||||
|
let errorJson = "" |
||||
|
if (e) { |
||||
|
errorJson = ": " + JSON.stringify(e, Object.getOwnPropertyNames(e)) |
||||
|
} |
||||
|
console.error(`bb-alert: ${message} ${errorJson}`) |
||||
|
} |
||||
Loading…
Reference in new issue