Skip to content

Conversation

@dai-shi
Copy link
Owner

@dai-shi dai-shi commented Apr 17, 2020

closes #40

@dai-shi dai-shi merged commit e344e66 into master Apr 19, 2020
@dai-shi dai-shi deleted the issue-40 branch April 19, 2020 00:23
const createFetchError = (message, responseBody) => {
const err = new Error(message);
const createFetchError = (response, responseBody) => {
const err = new Error(`${response.statusCode} ${response.statusText}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status instead statusCode

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developer.mozilla.org/en-US/docs/Web/API/Response/status

Oops! Please note, my recommendation is to use err.response.status instead of err.message, which is rather for logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants