From 2f20bc16193550773a49ad5a67b93c7dcf321c72 Mon Sep 17 00:00:00 2001 From: rr- Date: Thu, 23 Jun 2016 12:25:04 +0200 Subject: [PATCH] client/general: fix certain error handlers --- client/js/controllers/tag_categories_controller.js | 4 ++-- client/js/controllers/tag_controller.js | 4 ++-- client/js/controllers/user_controller.js | 2 +- client/js/controllers/user_registration_controller.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/js/controllers/tag_categories_controller.js b/client/js/controllers/tag_categories_controller.js index e381b3f..f33438d 100644 --- a/client/js/controllers/tag_categories_controller.js +++ b/client/js/controllers/tag_categories_controller.js @@ -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); }); } diff --git a/client/js/controllers/tag_controller.js b/client/js/controllers/tag_controller.js index 9ec66c5..08a3c09 100644 --- a/client/js/controllers/tag_controller.js +++ b/client/js/controllers/tag_controller.js @@ -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(); }); } diff --git a/client/js/controllers/user_controller.js b/client/js/controllers/user_controller.js index f9cacb7..31a562b 100644 --- a/client/js/controllers/user_controller.js +++ b/client/js/controllers/user_controller.js @@ -128,7 +128,7 @@ class UserController { ctx.controller.showSuccess('Account deleted.'); } }, errorMessage => { - this._view.showError(response.description); + this._view.showError(errorMessage); this._view.enableForm(); }); } diff --git a/client/js/controllers/user_registration_controller.js b/client/js/controllers/user_registration_controller.js index 623765a..db61efb 100644 --- a/client/js/controllers/user_registration_controller.js +++ b/client/js/controllers/user_registration_controller.js @@ -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!');