Do not show error page in notification on proxy upstream errors
This handles box being down and nginx delivers error page. We do not want to show that in the notification, but other box crash errors should be shown, they need to be fixed
This commit is contained in:
@@ -38,10 +38,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
// 401 is when the token is invalid. 403 can happen when the token is valid but missing scopes (like when user became admin)
|
||||
// re-login will make the code get a new token
|
||||
if (status === 401 || status === 403) return client.login();
|
||||
if (status >= 500) {
|
||||
if (!client.offline) client.error(data);
|
||||
client.offline = true;
|
||||
|
||||
if (status === 500 || status === 501) {
|
||||
if (!client.offline) client.error(data);
|
||||
} else if (status === 502 || status === 503 || status === 504) {
|
||||
// This means the box service is not reachable. We just show offline banner for now
|
||||
}
|
||||
|
||||
if (status >= 500) {
|
||||
client.offline = true;
|
||||
return callback(new ClientError(status, data));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user