Fixed The timeoutErrorMessage property in config not work with Node.js (fixes #3580)#3581
Conversation
…os#3580) * Adding "should respect the timeoutErrorMessage property" test case Co-authored-by: Will Loo <[email protected]>
…os#3580) * Fixing The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Updating http adapter * Adding reject config.timeoutErrorMessage when setup Co-authored-by: Will Loo <[email protected]>
djs113
left a comment
There was a problem hiding this comment.
Isn't is better to declare var timeoutErrorMessage = '' first then check if config has a timeoutErrorMessage property and if so assign it this value, else the default time out error message should be displayed. This will ensure that the default message is not unnecessarily created if config already has the error message.
var timeoutErrorMessage = '';
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
} else {
timeoutErrorMessage = 'timeout of ' + timeout + 'ms exceeded';
}
…js (axios#3580) * Fixing The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Update http adapter * Make changes as suggested after code review Co-authored-by: Will Loo <[email protected]>
@daniel-julius-sam done |
|
Please link this PR to the relevant issue by including |
|
That's not what I meant, you should add |
|
@djs113 Got it, already updated. Please approve this workflow. |
|
I'm not a mainainer, @jasonsaayman please approve this. |
|
@duibu05 please can you mend the conflict? |
@jasonsaayman done |
fixes axios#3580) (axios#3581) * The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Adding "should respect the timeoutErrorMessage property" test case Co-authored-by: Will Loo <[email protected]> * The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Fixing The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Updating http adapter * Adding reject config.timeoutErrorMessage when setup Co-authored-by: Will Loo <[email protected]> * Fixing The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Fixing The timeoutErrorMessage property in config not work with Node.js (axios#3580) * Update http adapter * Make changes as suggested after code review Co-authored-by: Will Loo <[email protected]> Co-authored-by: Jay <[email protected]>
This PR fixes #3580, the issue is that when send axios request in Node.js contains timeout, timeoutErrorMessage properties in config then fired timeout, the error message is not the customized timeoutErrorMessage but "timeout of *ms exceeded". This PR fixes that problem.