client/general: fix certain error handlers

This commit is contained in:
rr- 2016-06-23 12:25:04 +02:00
parent c7f6663c36
commit 2f20bc1619
4 changed files with 7 additions and 7 deletions

View file

@ -22,9 +22,9 @@ class TagCategoriesController {
canSetDefault: api.hasPrivilege('tagCategories:setDefault'),
});
this._view.addEventListener('submit', e => this._evtSubmit(e));
}, response => {
}, errorMessage => {
this._view = new EmptyView();
this._view.showError(response.description);
this._view.showError(errorMessage);
});
}

View file

@ -60,8 +60,8 @@ class TagController {
e.detail.tag.save().then(() => {
this._view.showSuccess('Tag saved.');
this._view.enableForm();
}, response => {
this._view.showError(response.description);
}, errorMessage => {
this._view.showError(errorMessage);
this._view.enableForm();
});
}

View file

@ -128,7 +128,7 @@ class UserController {
ctx.controller.showSuccess('Account deleted.');
}
}, errorMessage => {
this._view.showError(response.description);
this._view.showError(errorMessage);
this._view.enableForm();
});
}

View file

@ -23,8 +23,8 @@ class UserRegistrationController {
user.save().then(() => {
api.forget();
return api.login(e.detail.name, e.detail.password, false);
}, response => {
return Promise.reject(response.description);
}, errorMessage => {
return Promise.reject(errorMessage);
}).then(() => {
const ctx = router.show('/');
ctx.controller.showSuccess('Welcome aboard!');