From 90e6a8e46717f96ddbd0d07183b8a72201d6f32c Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 23 Apr 2016 22:20:44 +0200 Subject: [PATCH] Global method for response error handling --- dashboard-ui/scripts/site.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 5b41f2f9cd..ee13ae4403 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -455,6 +455,22 @@ var Dashboard = { }); }, + processErrorResponse: function (response) { + + Dashboard.hideLoadingMsg(); + + var status = '' + response.status; + + if (response.statusText) { + status = response.statusText; + } + + Dashboard.alert({ + title: status, + message: response.headers ? response.headers.get('X-Application-Error-Code') : null + }); + }, + alert: function (options) { if (typeof options == "string") {