Skip to content

Commit

Permalink
Update README.md (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
berkansivri committed Mar 11, 2021
1 parent d8fc32d commit 9e50c5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -235,14 +235,14 @@ const fetch = require('node-fetch');
class HTTPResponseError extends Error {
constructor(response, ...args) {
this.response = response;
super(`HTTP Error Response: ${res.status} ${res.statusText}`, ...args);
super(`HTTP Error Response: ${response.status} ${response.statusText}`, ...args);
}
}

const checkStatus = response => {
if (response.ok) {
// response.status >= 200 && response.status < 300
return res;
return response;
} else {
throw new HTTPResponseError(response);
}
Expand Down

0 comments on commit 9e50c5b

Please sign in to comment.