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.
package/dist/index.cjs CHANGED
@@ -94,16 +94,18 @@ var fetchAsync = function fetchAsync(method, URL, body, token, headers) {
94
94
  }();
95
95
  return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
96
96
  });
97
- }, function (error) {
98
- if (error instanceof Error) {
97
+ }, function (response) {
98
+ if (response instanceof Error) {
99
99
  throw {
100
- error: error
100
+ response: response
101
101
  };
102
102
  }
103
- return Promise.resolve(error.json()).then(function (json) {
103
+ return Promise.resolve(response.json()).then(function (json) {
104
104
  throw {
105
105
  success: false,
106
- message: json.message || json.err
106
+ message: json.message || json.err,
107
+ status: response.status,
108
+ statusText: response.statusText
107
109
  };
108
110
  });
109
111
  }));