In our angular application, sometimes we get the return status of http -1. State -1 occurs in a popup that is closed, so the user does not affect it, just our logs.
I tried to handle this by doing
switch (response.status) {
case 0:
break;
case -1:
break;
case 401:
localStorageService.clearAll();
redirectToUrlAfterLogin.url = $location.path();
$location.path('/login');
What was proposed in AngularJS Issue # 12920
We definitely get fewer logs, but there are still some HTTP -1 status codes. Is there any other way that I should handle -1?
source
share