Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP error codes break loading bar #118

Closed
kaarelkivistik opened this issue Sep 24, 2014 · 1 comment
Closed

HTTP error codes break loading bar #118

kaarelkivistik opened this issue Sep 24, 2014 · 1 comment
Labels

Comments

@kaarelkivistik
Copy link

When request returns an error code, angular-loading-bar becomes broken and won't disappear anymore.

GET http://mysite/is-logged-in 401 (Unauthorized)
TypeError: Cannot read property 'config' of undefined
    at response (http://localhost:9001/bower_components/angular-loading-bar/build/loading-bar.js:116:24)

(Source)

'response': function(response) {
          if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
            reqsCompleted++;
            $rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url});
            if (reqsCompleted >= reqsTotal) {
              setComplete();
            } else {
              cfpLoadingBar.set(reqsCompleted / reqsTotal);
            }
          }
          return response;
        }

Seems that no config object is returned when request "failed" (401 was actually expected here).

@chieffancypants
Copy link
Owner

This is likely an issue with another interceptor. Angular requires a config option be passed to all interceptors.

More info: #50 (comment)

Closing for now as I've seen this issue a dozen times and each time it's been related to a bad interceptor. Please re-open if that's not the case, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants