summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-02-23 11:42:18 +0100
committerAleksander Machniak <alec@alec.pl>2012-02-23 11:42:18 +0100
commit9585885a269813009c3c3fb540e306a0be98b9b5 (patch)
tree559520441ca3732c83294871bca6f11d3a102588
parent14f2d3b76c1c4a07c84a2d4bd7406f65b12adb27 (diff)
downloadwebadmin-9585885a269813009c3c3fb540e306a0be98b9b5.tar.gz
Improved API reponse handler
-rw-r--r--public_html/js/kolab_admin.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index 89ee9ec..f2271ba 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -349,14 +349,12 @@ function kolab_admin()
this.api_response = function(response)
{
- if (!response)
- return false;
-
this.update_request_time();
this.set_busy(false);
- if (response.status == 'ERROR') {
- this.display_message(response.reason, 'error');
+ if (!response || response.status != 'OK') {
+ var msg = response && response.reason ? response.reason : this.t('servererror');
+ this.display_message(msg, 'error');
return false;
}