shitton
This commit is contained in:
+8
-6
@@ -21,8 +21,9 @@ export class Ae extends Command {
|
||||
try {
|
||||
let result = this.executeEvaluation(match);
|
||||
await oldSendMessage(msg, result).catch(async () => await errorPlaceholder(msg));
|
||||
} catch (e: any) {
|
||||
const text = e.message.toString();
|
||||
} catch (e: unknown) {
|
||||
const error = e instanceof Error ? e : new Error(String(e));
|
||||
const text = error.message.toString();
|
||||
|
||||
if (text.includes("is not defined")) {
|
||||
await oldSendMessage(msg, Environment.variableNotDefinedText).catch(logError);
|
||||
@@ -30,7 +31,7 @@ export class Ae extends Command {
|
||||
}
|
||||
|
||||
logError(`${text}
|
||||
* Stacktrace: ${e.stack}`);
|
||||
* Stacktrace: ${error.stack}`);
|
||||
|
||||
await oldSendMessage(msg, text).catch(logError);
|
||||
}
|
||||
@@ -43,15 +44,16 @@ export class Ae extends Command {
|
||||
e = ((typeof e == "string") ? e : JSON.stringify(e));
|
||||
|
||||
return e;
|
||||
} catch (e: any) {
|
||||
const text = e.message.toString();
|
||||
} catch (e: unknown) {
|
||||
const error = e instanceof Error ? e : new Error(String(e));
|
||||
const text = error.message.toString();
|
||||
|
||||
if (text.includes("is not defined")) {
|
||||
return Environment.evaluationVariableNotDefinedText;
|
||||
}
|
||||
|
||||
logError(`${text}
|
||||
* Stacktrace: ${e.stack}`);
|
||||
* Stacktrace: ${error.stack}`);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user