Skip to content

Commit d576a46

Browse files
committed
return statusCode on json parse error (#51)
1 parent 7e46600 commit d576a46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/fetch.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export function fetchImpl(
4242
return response.json().then((json) => {
4343
onNext([json], { responseHeaders: response.headers });
4444
onComplete();
45+
}, (err) => {
46+
const parseError = err;
47+
parseError.response = response;
48+
parseError.statusCode = response.status;
49+
onError(parseError);
4550
});
4651
}
4752
})

0 commit comments

Comments
 (0)