mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 13:43:06 -04:00
standardize error messages
This commit is contained in:
parent
295072d388
commit
e523b5402e
4 changed files with 15 additions and 11 deletions
|
@ -1,3 +1,4 @@
|
|||
const { icon } = require('#utils/markdown')
|
||||
const superagent = require('superagent')
|
||||
|
||||
const MAINTOWER_BASE_URL = process.env.MAINTOWER_URL
|
||||
|
@ -5,6 +6,10 @@ const MAINTOWER_BASE_URL = process.env.MAINTOWER_URL
|
|||
let maintowerClient = "1fepg2wdk-prod"
|
||||
if(process.env.MAINTOWER_OVERRIDE) maintowerClient = process.env.MAINTOWER_OVERRIDE
|
||||
|
||||
module.exports.formatErrorMessage = (sev = 0, code, content) => {
|
||||
return `${icon("webhook_exclaim_" + parseInt(sev))} \`[${Date.now()}]\` @ \`[${process.env.HOSTNAME}]\` **\` ${code} \`** | ${content}`
|
||||
}
|
||||
|
||||
module.exports.maintower = async function (packages, type){
|
||||
if(!MAINTOWER_BASE_URL) { console.warn("No maintower url configured."); return; }
|
||||
try{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue