diff --git a/documentation/examples/gh-got.js b/documentation/examples/gh-got.js index cbd8c374c..ba427844c 100644 --- a/documentation/examples/gh-got.js +++ b/documentation/examples/gh-got.js @@ -43,7 +43,7 @@ const instance = got.extend({ // Nicer errors if (response && response.body) { error.name = 'GitHubError'; - error.message = `${response.body.message} (${error.statusCode} status code)`; + error.message = `${response.body.message} (${response.statusCode} status code)`; } // Rate limit for errors diff --git a/documentation/lets-make-a-plugin.md b/documentation/lets-make-a-plugin.md index 35ba70f67..bdc868d60 100644 --- a/documentation/lets-make-a-plugin.md +++ b/documentation/lets-make-a-plugin.md @@ -144,7 +144,7 @@ We should name our errors, just to know if the error is from the API response. S // Nicer errors if (response && response.body) { error.name = 'GitHubError'; - error.message = `${response.body.message} (${error.statusCode} status code)`; + error.message = `${response.body.message} (${response.statusCode} status code)`; } throw error; @@ -216,7 +216,7 @@ const getRateLimit = (headers) => ({ // Nicer errors if (response && response.body) { error.name = 'GitHubError'; - error.message = `${response.body.message} (${error.statusCode} status code)`; + error.message = `${response.body.message} (${response.statusCode} status code)`; } // Rate limit for errors diff --git a/readme.md b/readme.md index fcdc64238..14123188b 100644 --- a/readme.md +++ b/readme.md @@ -654,7 +654,7 @@ got('https://api.github.com/some-endpoint', { const {response} = error; if (response && response.body) { error.name = 'GitHubError'; - error.message = `${response.body.message} (${error.statusCode})`; + error.message = `${response.body.message} (${response.statusCode})`; } return error;