Skip to content

Commit

Permalink
Update browser connection error notification
Browse files Browse the repository at this point in the history
  • Loading branch information
eputtone committed Dec 31, 2018
1 parent 273269a commit 180ad34
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions nflow-explorer/src/app/config/notificationFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@
return {
responseError: function(rejection) {
var toastr = $injector.get('toastr');
var toastrConfig = {
timeOut: 0
};
if (rejection.status === -1) {
toastr.error('Check network connection and CORS settings', 'REST API request aborted by browser', {
timeOut: 0
});
toastr.error('Check network connection, CORS settings and ensure that nFlow REST API is running',
'REST API request aborted by browser', toastrConfig);
} else if (rejection.status === 401 || rejection.status === 403) {
toastr.error('Authentication failed', {
timeOut: 0
});
toastr.error('Authentication failed', toastrConfig);
} else if (rejection.status === 404) {
toastr.error('Check that your URL is valid', 'Page not found', {
timeOut: 0
});
toastr.error('Check that your URL is valid', 'Page not found', toastrConfig);
} else if (rejection.status >= 500) {
toastr.error('Internal server error', {
timeOut: 0
});
toastr.error('Internal server error', toastrConfig);
}
return $q.reject(rejection);
}
Expand Down

0 comments on commit 180ad34

Please sign in to comment.