opensourcecontributors icon indicating copy to clipboard operation
opensourcecontributors copied to clipboard

Handle errors in which the server is down

Open hut8 opened this issue 10 years ago • 0 comments

When the server is down, the responseError handler is still called. But then rejection.data is null, which causes another error! :cry:

    function ConfigureErrorHandler($httpProvider) {
        $httpProvider.interceptors.push(function($q, $rootScope, $log, $injector) {
             return {
                 'responseError': function(rejection) {
                     $log.debug(rejection);
                     $rootScope.errorDescription = rejection.data.error;

hut8 avatar Feb 07 '16 21:02 hut8