Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 103145e

Browse files
committed
Add status code and text to request error messages
1 parent ad6be66 commit 103145e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Requestable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ function getNextPage(linksHeader = '') {
283283

284284
function callbackErrorOrThrow(cb, path) {
285285
return function handler(response) {
286-
let message = `error making request ${response.config.method} ${response.config.url}`;
286+
let message = (`${response.status} error making request ` +
287+
`${response.config.method} ${response.config.url}: ` +
288+
`"${response.statusText}"`);
287289
let error = new ResponseError(message, path, response);
288290
log(`${message} ${JSON.stringify(response.data)}`);
289291
if (cb) {

0 commit comments

Comments
 (0)