From dde19bd53ce82e40b8ec3f434282b8e54b7e3e31 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 31 Oct 2012 11:44:33 +0100 Subject: [PATCH] Improved shown error messages. --- app/assets/javascripts/app/lib/app/ajax.js.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/javascripts/app/lib/app/ajax.js.coffee b/app/assets/javascripts/app/lib/app/ajax.js.coffee index 531d2a371..af78b81c5 100644 --- a/app/assets/javascripts/app/lib/app/ajax.js.coffee +++ b/app/assets/javascripts/app/lib/app/ajax.js.coffee @@ -37,6 +37,16 @@ class _Singleton detail = jqxhr.responseText if !status && !detail detail = 'General communication error, maybe internet is not available!' + + # do not show any error message on wrong login + return if status is 422 + + # show human readable message + if status is 401 + status = 'Access denied.' + detail = '' + + # show error message new App.ErrorModal( message: 'StatusCode: ' + status detail: detail