mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.error(error ? error.stack || error.message : error);
|
||||||
|
|
||||||
// Log the error via our maintower service
|
// Log the error via our maintower service
|
||||||
let packages = {
|
let packages = {
|
||||||
data: {},
|
data: {},
|
||||||
|
@ -182,6 +184,8 @@ interactionClient.on('commandRunError', async ({context, error}) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.error(error ? error.stack || error.message : error);
|
||||||
|
|
||||||
// Log the error via our maintower service
|
// Log the error via our maintower service
|
||||||
let packages = {
|
let packages = {
|
||||||
data: {},
|
data: {},
|
||||||
|
@ -232,7 +236,8 @@ interactionClient.on('commandRunError', async ({context, error}) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
cluster.on(ClientEvents.WARN, async ({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}\`\`\``));
|
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;
|
if(res.body.status == 0) return res.body.id;
|
||||||
throw res.body.message
|
throw res.body.message
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log(e)
|
console.log(packages)
|
||||||
throw "Maintower request failed."
|
console.error("Maintower request failed.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ module.exports.basecamp = async function (log, content = ""){
|
||||||
.send({log, content})
|
.send({log, content})
|
||||||
return;
|
return;
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log(e)
|
console.log(log)
|
||||||
throw "Basecamp request failed."
|
console.error("Basecamp request failed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue