{"size": 437, "ext": "js", "max_stars_repo_path": "yo/app/scripts/services/http-error.interceptor.js", "max_stars_repo_name": "icatproject/topca", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "yo/app/scripts/services/http-error.interceptor.js", "max_issues_repo_name": "icatproject/topca", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "yo/app/scripts/services/http-error.interceptor.js", "max_forks_repo_name": "icatproject/topca", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.2777777778, "max_line_length": 70, "alphanum_fraction": 0.4874141876}
(function() {
    'use strict';

    var app = angular.module('topcat');

    app.factory('HttpErrorInterceptor', function($q, $rootScope){
        return {
            responseError: function(rejection) {
                if(rejection.status >= 400 && rejection.status < 500){
                    $rootScope.$broadcast('http:error');
                }
                return $q.reject(rejection);
            }
        };
    });

})();
