-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed The timeoutErrorMessage property in config not work with Node.js (fixes #3580) #3581
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 <duibu05@126.com>
…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 <duibu05@126.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <duibu05@126.com>
@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 <duibu05@126.com> * 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 <duibu05@126.com> * 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 <duibu05@126.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
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.