mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-07 22:28:01 +02:00
feat: improve error management in front end
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
{
|
{
|
||||||
"ERRORS": {
|
"ERRORS": {
|
||||||
|
"unknown_error": "Unknown error, contact the admin.",
|
||||||
|
"unreachable": "Anonymous GitHub is unreachable, contact the admin.",
|
||||||
"request_error": "Unable to download the file, check your connection or contact the admin.",
|
"request_error": "Unable to download the file, check your connection or contact the admin.",
|
||||||
"repo_not_found": "The repository is not found.",
|
"repo_not_found": "The repository is not found.",
|
||||||
"repo_not_accessible": "Anonymous GitHub is unable to or is forbidden to access the repository.",
|
"repo_not_accessible": "Anonymous GitHub is unable to or is forbidden to access the repository.",
|
||||||
|
|||||||
@@ -1667,6 +1667,7 @@ angular
|
|||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
$scope.type = "error";
|
$scope.type = "error";
|
||||||
|
$scope.content = "unknown_error";
|
||||||
try {
|
try {
|
||||||
err.data = JSON.parse(err.data);
|
err.data = JSON.parse(err.data);
|
||||||
if (err.data.error) {
|
if (err.data.error) {
|
||||||
@@ -1678,6 +1679,9 @@ angular
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
if (err.status == -1) {
|
if (err.status == -1) {
|
||||||
$scope.content = "request_error";
|
$scope.content = "request_error";
|
||||||
|
} else if (err.status == 502) {
|
||||||
|
// cloudflare error
|
||||||
|
$scope.content = "unreachable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user