Clean up logging and fix error handling
This commit is contained in:
@@ -15,17 +15,21 @@ class ErrorMessage {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
get status() {
|
||||
return this.error.status;
|
||||
}
|
||||
hasErrorWithCode(code) {
|
||||
return this.githubErrors.some((err) => err.code == code);
|
||||
}
|
||||
toString() {
|
||||
const message = this.error.message;
|
||||
const errors = this.githubErrors;
|
||||
const status = this.status;
|
||||
if (errors.length > 0) {
|
||||
return `${message}\nErrors:\n${this.errorBulletedList(errors)}`;
|
||||
return `Error ${status}: ${message}\nErrors:\n${this.errorBulletedList(errors)}`;
|
||||
}
|
||||
else {
|
||||
return message;
|
||||
return `Error ${status}: ${message}`;
|
||||
}
|
||||
}
|
||||
errorBulletedList(errors) {
|
||||
|
||||
Reference in New Issue
Block a user