feat: improve response content type header

This commit is contained in:
tdurieux
2023-04-25 17:42:50 +02:00
parent 8ac3a66a30
commit c9acb7b899
4 changed files with 25 additions and 10 deletions
+1
View File
@@ -1,5 +1,6 @@
{
"ERRORS": {
"request_error": "Unable to download the file, check your connection or contact the admin.",
"repo_not_found": "The repository is not found.",
"repo_not_accessible": "Anonymous GitHub is unable to or is forbidden to access the repository.",
"repository_expired": "The repository is expired",
+10 -5
View File
@@ -1669,11 +1669,16 @@ angular
$scope.type = "error";
try {
err.data = JSON.parse(err.data);
} catch (ignore) {}
if (err.data.error) {
$scope.content = err.data.error;
} else {
$scope.content = err.data;
if (err.data.error) {
$scope.content = err.data.error;
} else {
$scope.content = err.data;
}
} catch (ignore) {
console.log(err);
if (err.status == -1) {
$scope.content = "request_error";
}
}
}
);