ywana-core8 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,16 +85,18 @@ var fetchAsync = function fetchAsync(method, URL, body, token, headers) {
85
85
  }();
86
86
  return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
87
87
  });
88
- }, function (error) {
89
- if (error instanceof Error) {
88
+ }, function (response) {
89
+ if (response instanceof Error) {
90
90
  throw {
91
- error: error
91
+ response: response
92
92
  };
93
93
  }
94
- return Promise.resolve(error.json()).then(function (json) {
94
+ return Promise.resolve(response.json()).then(function (json) {
95
95
  throw {
96
96
  success: false,
97
- message: json.message || json.err
97
+ message: json.message || json.err,
98
+ status: response.status,
99
+ statusText: response.statusText
98
100
  };
99
101
  });
100
102
  }));