diff --git a/src/index.js b/src/index.js index ea86dba..e5b9f22 100644 --- a/src/index.js +++ b/src/index.js @@ -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); }); @@ -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); });