fix(core): make sure timeout error messages include URLs (#7981)

Before this fix, timeout messages are not quite useful

> error: Request undefined fail, retry attempt #1: TimeoutError: Timeout awaiting 'request' for 5000ms
This commit is contained in:
Chih-Hsuan Yen
2021-08-12 16:27:07 +08:00
committed by GitHub
parent 47d1305f95
commit 1c9c4ccfc8
2 changed files with 7 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ const custom = got.extend({
hooks: {
beforeRetry: [
(options, err, count) => {
logger.error(`Request ${err.url} fail, retry attempt #${count}: ${err}`);
logger.error(`Request ${options.url} fail, retry attempt #${count}: ${err}`);
},
],
afterResponse: [