Skip to content

Commit

Permalink
Throw ETIMEDOUT on timeout when clarifyTimeoutError is true
Browse files Browse the repository at this point in the history
  • Loading branch information
askielboe authored and marcbachmann committed Apr 12, 2023
1 parent 60793dd commit 29e9da5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ VERBS.concat("any").forEach(function (method) {
"timeout of " + config.timeout + "ms exceeded",
config,
undefined,
"ECONNABORTED"
config.transitional?.clarifyTimeoutError
? "ETIMEDOUT"
: "ECONNABORTED"
);
return Promise.reject(error);
});
Expand All @@ -174,7 +176,9 @@ VERBS.concat("any").forEach(function (method) {
"timeout of " + config.timeout + "ms exceeded",
config,
undefined,
"ECONNABORTED"
config.transitional?.clarifyTimeoutError
? "ETIMEDOUT"
: "ECONNABORTED"
);
return Promise.reject(error);
});
Expand Down

0 comments on commit 29e9da5

Please sign in to comment.