Repository: lens
Updated Branches:
  refs/heads/master 35e30e4c1 -> 42589c3fb


LENS-856 : Handle errors when response text is empty by capturing HTTP status 
code


Project: http://git-wip-us.apache.org/repos/asf/lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/42589c3f
Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/42589c3f
Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/42589c3f

Branch: refs/heads/master
Commit: 42589c3fb122d8e79273c8d60a0530352339fc44
Parents: 35e30e4
Author: Ankeet Maini <[email protected]>
Authored: Mon Nov 9 15:17:35 2015 +0530
Committer: Deepak Kumar Barr <[email protected]>
Committed: Mon Nov 9 15:17:35 2015 +0530

----------------------------------------------------------------------
 lens-ui/app/adapters/BaseAdapter.js | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lens/blob/42589c3f/lens-ui/app/adapters/BaseAdapter.js
----------------------------------------------------------------------
diff --git a/lens-ui/app/adapters/BaseAdapter.js 
b/lens-ui/app/adapters/BaseAdapter.js
index b22eefc..634b974 100644
--- a/lens-ui/app/adapters/BaseAdapter.js
+++ b/lens-ui/app/adapters/BaseAdapter.js
@@ -46,6 +46,14 @@ function makeReqwest (url, method, data, options = {}) {
         let response = error.responseType !== 'json' ?
           XMLAdapter.stringToXML(error.response) :
           error.response;
+
+        if (!response) {
+          response = {
+            status: error.status,
+            statusText: error.statusText
+          };
+        }
+
         reject(response);
       }).catch(e => console.error(e));
   });

Reply via email to