larapi 0.1.1 → 0.1.2

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/lib/Http.js CHANGED
@@ -166,7 +166,7 @@ class Http extends Core_1.default {
166
166
  }
167
167
  else {
168
168
  if (xhr.status >= 400 && xhr.status <= 499) {
169
- fail(result);
169
+ this.fail(result);
170
170
  }
171
171
  this.error(result);
172
172
  console.warn(result);
@@ -177,6 +177,7 @@ class Http extends Core_1.default {
177
177
  }
178
178
  catch (e) {
179
179
  console.warn(e);
180
+ throw e;
180
181
  }
181
182
  return this;
182
183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larapi",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "API client for laravel",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/Http.ts CHANGED
@@ -165,7 +165,7 @@ class Http extends Core {
165
165
  this.success(result);
166
166
  }else{
167
167
  if (xhr.status >= 400 && xhr.status <= 499) {
168
- fail(result);
168
+ this.fail(result);
169
169
  }
170
170
 
171
171
  this.error(result);
@@ -176,6 +176,7 @@ class Http extends Core {
176
176
  xhr.send(this.requestParams.body);
177
177
  }catch(e) {
178
178
  console.warn(e);
179
+ throw e;
179
180
  }
180
181
  return this
181
182
  }