Display error messages

This commit is contained in:
tdurieux
2021-03-19 13:26:29 +01:00
parent 54bc4e176d
commit 72715dfcd9
17 changed files with 117 additions and 33 deletions

View File

@@ -416,13 +416,13 @@ module.exports.isFilePathValid = async (options) => {
}
if (error.status == 403) {
console.log(error);
throw "content_too_large";
throw "file_too_big";
}
throw error;
}
}
if (!ghRes.data.content && ghRes.data.size != 0) {
throw "content_not_accessible";
throw "file_not_accessible";
}
// empty file
let content = "";
@@ -460,7 +460,7 @@ module.exports.getStats = async (options) => {
if (repoConfig == null) {
throw "repo_not_found";
}
if (repoConfig.mode == "stream") {
if (repoConfig.mode != "download") {
throw "stats_unsupported";
}