When the server is down, the responseError handler is still called. But then rejection.data is null, which causes another error! 😢
function ConfigureErrorHandler($httpProvider) {
$httpProvider.interceptors.push(function($q, $rootScope, $log, $injector) {
return {
'responseError': function(rejection) {
$log.debug(rejection);
$rootScope.errorDescription = rejection.data.error;