Search code examples
angularjshttp-status-code-401angular-httpangular-http-interceptors

400, 401 error not catched by angularjs http interceptor or $http().catch()


When writing $http() queries i found that nor interceptor configured with $httpProvider.interceptors.push('myHttpInterceptor') neither $http().catch() never fired with 401 or 400 error. What is going on?


Solution

  • The problem :there is an interceptor already , that i installed but poorly configured.
    In my case it was angular-http-auth. After removing it 401 is catched as it should be.