mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
fix bot crashing when very specific errors get thrown
This commit is contained in:
parent
f642054f0d
commit
2e523b1dad
2 changed files with 10 additions and 5 deletions
|
@ -138,6 +138,8 @@ commandClient.on('commandRunError', async ({context, error}) => {
|
|||
return;
|
||||
}
|
||||
|
||||
console.error(error ? error.stack || error.message : error);
|
||||
|
||||
// Log the error via our maintower service
|
||||
let packages = {
|
||||
data: {},
|
||||
|
@ -182,6 +184,8 @@ interactionClient.on('commandRunError', async ({context, error}) => {
|
|||
return;
|
||||
}
|
||||
|
||||
console.error(error ? error.stack || error.message : error);
|
||||
|
||||
// Log the error via our maintower service
|
||||
let packages = {
|
||||
data: {},
|
||||
|
@ -232,7 +236,8 @@ interactionClient.on('commandRunError', async ({context, error}) => {
|
|||
});
|
||||
|
||||
cluster.on(ClientEvents.WARN, async ({error}) => {
|
||||
if(!process.env.MAINTOWER_URL) { console.warn(error); return; }
|
||||
console.warn(error);
|
||||
if(!process.env.MAINTOWER_URL) return;
|
||||
await basecamp(formatErrorMessage(2, "CLUSTER_WARNING", `\`Cluster ${cluster.manager.clusterId} reported warning\`:\n\`\`\`${error}\`\`\``));
|
||||
});
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ module.exports.maintower = async function (packages, type){
|
|||
if(res.body.status == 0) return res.body.id;
|
||||
throw res.body.message
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
throw "Maintower request failed."
|
||||
console.log(packages)
|
||||
console.error("Maintower request failed.")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ module.exports.basecamp = async function (log, content = ""){
|
|||
.send({log, content})
|
||||
return;
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
throw "Basecamp request failed."
|
||||
console.log(log)
|
||||
console.error("Basecamp request failed.");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue