Permalink
Browse files

fix(rest): Reject on wrong statuscode

  • Loading branch information...
RWOverdijk committed Dec 23, 2015
1 parent c90f8e0 commit 7adaa65b08a4dc7eeda1b7fd794057270c81c3fe
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/rest.js
@@ -42,7 +42,11 @@ export class Rest {
}

return this.client.fetch(path, requestOptions).then(response => {
return response.json().catch(error => null);
if (response.status >= 200 && response.status < 400) {
return response.json().catch(error => null);
}

throw response;
});
}

0 comments on commit 7adaa65

Please sign in to comment.