1angular 2 .module('irk') 3 .factory('exceptionInterceptor', function($rootScope, $q, $templateCache, toaster, $location, Session, $injector) { 4 var responseInterceptor = { 5 responseError: function(rejectReason) { 6 console.error("exceptionInterceptor", arguments); 7 var i18n = $injector.get('i18n'); 8 if(rejectReason.status === 500) { 9 $rootScope.exception = rejectReason.data; 10 toaster.pop('error', "Exception", rejectReason.data.message); 11 return $location.path('/SytuacjaWyjatkowa'); 12 } 13 else if(rejectReason.status === 0) { 14 // ignorujemy wyjatki od uploadera 15 if(rejectReason.config && rejectReason.config.url === 'REST/upload/upload') { 16 return $q.reject(rejectReason); 17 } 18 i18n.get('interfejs.irk.shared.exception.Refresh').then(function(komunikat) { 19 toaster.pop('error', komunikat || 'Server connection error'); 20 }); 21 return $location.path('/StronaGlowna'); 22 } 23 else if(rejectReason.status === 401) { 24 Session.destroy(); 25 i18n.get('interfejs.irk.shared.exception.Logout').then(function(komunikat) { 26 toaster.pop('error', komunikat); 27 }); 28 return $location.path('/Logowanie'); 29 } 30 else if(rejectReason.status === 403) { 31 Session.destroy(); 32 i18n.get('interfejs.irk.shared.exception.Privileges').then(function(komunikat) { 33 toaster.pop('error', komunikat); 34 }); 35 return $location.path('/Logowanie'); 36 } 37 return $q.reject(rejectReason); 38 } 39 }; 40 return responseInterceptor; 41 }). 42 config(function($httpProvider) { 43 $httpProvider.interceptors.push('exceptionInterceptor'); 44 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.