frontend: console.log is not a good way to handle errors

This commit is contained in:
nemunaire 2018-12-01 16:13:53 +01:00
parent 07cea2e04a
commit 0414c392bf
2 changed files with 5 additions and 2 deletions

View file

@ -221,6 +221,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$scope.hsubmit = function(hint) {
hint.submitted = true;
$scope.hinterror = null;
$http({ url: "/openhint/" + $rootScope.current_exercice, method: "POST", data: { id: hint.id } }).then(function(response, status, header, config) {
var checkDiffHint = function() {
$http.get("/my.json").then(function(response) {
@ -239,8 +240,8 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
};
checkDiffHint();
}, function(response, status, header, config) {
$scope.hinterror = response.data.errmsg;
hint.submitted = false;
console.error(response.data.errmsg);
});
};
})
@ -488,7 +489,6 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$location.url("/");
}, function(response) {
$scope.messageClass = {"text-danger": true};
console.log(response);
if (response.data && response.data.errmsg)
$scope.message = response.data.errmsg;
else