fix: shortmessage error handling not working

This commit is contained in:
Jelle Glebbeek
2021-05-20 22:01:47 +02:00
parent 75982fdea3
commit b4e7ddbd28
2 changed files with 4 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ class ErrorHandler {
let foundError = false;
if(stderr == null) {
console.error("An error has occurred but no error message was given.")
return;
return false;
}
for(const errorDef of this.errorDefinitions) {
if(stderr.includes(errorDef.trigger)) {

View File

@@ -43,7 +43,9 @@ class Query {
return stdout
} catch(e) {
if(!this.environment.errorHandler.checkError(e.stderr, this.identifier)) {
this.environment.errorHandler.raiseUnhandledError("Please report this error.\n" + JSON.stringify(e, null, 2), this.identifier);
if(!this.environment.errorHandler.checkError(e.shortMessage, this.identifier)) {
this.environment.errorHandler.raiseUnhandledError("Please report this error.\n" + JSON.stringify(e, null, 2), this.identifier);
}
}
return "{}";
}