[CORD-967] Displaying correct error in the GUI
Change-Id: I28ecf2e7b301c4745e256a6e683f684fd4a72c4f
diff --git a/src/interceptors.ts b/src/interceptors.ts
index 8a11d08..a1b5df8 100644
--- a/src/interceptors.ts
+++ b/src/interceptors.ts
@@ -11,17 +11,16 @@
switch (res.status) {
case -1:
case 401:
- case 500:
$cookies.remove('sessionid', {path: '/'});
$state.go('login');
return $q.reject(res);
default:
- return res;
+ return $q.reject(res);
}
};
return {
- response: checkLogin,
+ // response: checkLogin,
responseError: checkLogin
};
}
@@ -39,7 +38,7 @@
};
}
-export function NoHyperlinksInterceptor() {
+export function NoHyperlinksInterceptor($q: ng.IQService) {
return {
request: (req) => {
if (req.url.indexOf('.html') === -1) {
@@ -68,6 +67,9 @@
res.data = res.data;
}
return res;
+ },
+ responseError: (res) => {
+ return $q.reject(res.data);
}
};
}