Make Client.error() persistent and allow to pass an action
This commit is contained in:
@@ -178,16 +178,18 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
this.setToken(localStorage.token);
|
||||
}
|
||||
|
||||
Client.prototype.error = function (error) {
|
||||
Client.prototype.error = function (error, action) {
|
||||
var message = '';
|
||||
|
||||
console.error(error);
|
||||
|
||||
if (typeof error === 'object') {
|
||||
message = error.message || error;
|
||||
} else {
|
||||
message = error;
|
||||
}
|
||||
|
||||
Notification.error({ title: 'Cloudron Error', message: message });
|
||||
this.notify('Cloudron Error', message, true, 'error', action);
|
||||
};
|
||||
|
||||
// handles application startup errors, mostly only when dashboard is loaded and api endpoint is down
|
||||
|
||||
Reference in New Issue
Block a user