Another try at error logging
This commit is contained in:
parent
2d050046e4
commit
0135717854
2 changed files with 2 additions and 2 deletions
|
@ -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)}`,
|
||||
|
|
|
@ -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>"
|
||||
|
|
Loading…
Reference in a new issue