Another try at error logging

This commit is contained in:
Essem 2022-07-22 18:50:40 -05:00
parent 2d050046e4
commit 0135717854
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 2 additions and 2 deletions

View file

@ -57,7 +57,7 @@ export default async (client, cluster, worker, ipc, interaction) => {
} else if (error.toString().includes("Timed out")) {
await interaction[replyMethod]("The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size.");
} else {
logger.error(`Error occurred with slash command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${typeof error === "object" ? JSON.stringify(error) : error.toString()}`);
logger.error(`Error occurred with slash command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${error.stack || error}`);
try {
await interaction[replyMethod]("Uh oh! I ran into an error while running this command. Please report the content of the attached file at the following link or on the esmBot Support server: <https://github.com/esmBot/esmBot/issues>", {
file: `Message: ${await clean(error)}\n\nStack Trace: ${await clean(error.stack)}`,

View file

@ -153,7 +153,7 @@ export default async (client, cluster, worker, ipc, message) => {
content: "The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size."
}, reference));
} else {
_error(`Error occurred with command message ${message.cleanContent}: ${typeof error === "object" ? JSON.stringify(error) : error.toString()}`);
_error(`Error occurred with command message ${message.cleanContent}: ${error.stack || error}`);
try {
await client.createMessage(message.channel.id, Object.assign({
content: "Uh oh! I ran into an error while running this command. Please report the content of the attached file at the following link or on the esmBot Support server: <https://github.com/esmBot/esmBot/issues>"