Skip to content

Commit 08f260e

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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy