Fixes #301 Add remediation suggestion to 404 errors
This commit is contained in:
@@ -27,14 +27,20 @@ class GithubError {
|
||||
const errors = this.githubErrors;
|
||||
const status = this.status;
|
||||
if (errors.length > 0) {
|
||||
return `Error ${status}: ${message}\nErrors:\n${this.errorBulletedList(errors)}`;
|
||||
return `Error ${status}: ${message}\nErrors:\n${this.errorBulletedList(errors)}${this.remediation()}`;
|
||||
}
|
||||
else {
|
||||
return `Error ${status}: ${message}`;
|
||||
return `Error ${status}: ${message}${this.remediation()}`;
|
||||
}
|
||||
}
|
||||
errorBulletedList(errors) {
|
||||
return errors.map((err) => `- ${err}`).join("\n");
|
||||
}
|
||||
remediation() {
|
||||
if (this.status == 404) {
|
||||
return "\nMake sure your github token has access to the repo and has permission to author releases";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
exports.GithubError = GithubError;
|
||||
|
||||
Reference in New Issue
Block a user