Make error of the execution more verbose to the user
This commit is contained in:
parent
c03d329c3d
commit
f9097ae68d
1 changed files with 8 additions and 1 deletions
|
@ -286,12 +286,19 @@ async function executeFromQueue(channel: string) {
|
||||||
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
|
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
|
let errorText = "\n";
|
||||||
|
|
||||||
|
if (e instanceof Error) {
|
||||||
|
errorText += e.message;
|
||||||
|
}
|
||||||
|
else errorText = "";
|
||||||
|
|
||||||
requestReply(
|
requestReply(
|
||||||
message,
|
message,
|
||||||
{
|
{
|
||||||
embeds: [{
|
embeds: [{
|
||||||
color: 0xff0000,
|
color: 0xff0000,
|
||||||
description: "Something bad happened! :frowning:"
|
description: "Something bad happened! :frowning:" + errorText
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
{allowedMentions: { repliedUser: false } },
|
{allowedMentions: { repliedUser: false } },
|
||||||
|
|
Loading…
Reference in a new issue