IUUUUU
This commit is contained in:
parent
6a5fbf3790
commit
dea0915d9b
4
index.js
4
index.js
|
@ -1664,11 +1664,11 @@ dcClient.on('interactionCreate', async interaction => {
|
||||||
// Lets actually handle exceptions now
|
// Lets actually handle exceptions now
|
||||||
process.on('unhandledRejection', (error) => {
|
process.on('unhandledRejection', (error) => {
|
||||||
// Log a full error with line number
|
// Log a full error with line number
|
||||||
sendLog(`${colors.red("[ERROR]")} ${error.stack}`);
|
sendLog(`${colors.red("[ERROR]")} ${JSON.stringify(error)}`);
|
||||||
// If config.ntfyUrl is set, Send the exception to ntfy
|
// If config.ntfyUrl is set, Send the exception to ntfy
|
||||||
if (config.ntfyUrl) fetch(config.ntfyUrl, {
|
if (config.ntfyUrl) fetch(config.ntfyUrl, {
|
||||||
method: 'POST', // PUT works too
|
method: 'POST', // PUT works too
|
||||||
body: error.stack,
|
body: JSON.stringify(error),
|
||||||
headers: {
|
headers: {
|
||||||
'Title': 'FreePBX Bot Rejection',
|
'Title': 'FreePBX Bot Rejection',
|
||||||
'Priority': 5,
|
'Priority': 5,
|
||||||
|
|
Loading…
Reference in a new issue