mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
custom timeout prompt copy (#2275)
* style: ui * feat: custom timeout txtx * feat: custom timeout txtx
This commit is contained in:
Vendored
+1
@@ -49,6 +49,7 @@ export interface AxiosRequestConfig {
|
||||
paramsSerializer?: (params: any) => string;
|
||||
data?: any;
|
||||
timeout?: number;
|
||||
timeoutErrorMessage?: string;
|
||||
withCredentials?: boolean;
|
||||
adapter?: AxiosAdapter;
|
||||
auth?: AxiosBasicCredentials;
|
||||
|
||||
+5
-1
@@ -88,7 +88,11 @@ module.exports = function xhrAdapter(config) {
|
||||
|
||||
// Handle timeout
|
||||
request.ontimeout = function handleTimeout() {
|
||||
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
|
||||
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
||||
if (config.timeoutErrorMessage) {
|
||||
timeoutErrorMessage = config.timeoutErrorMessage;
|
||||
}
|
||||
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
|
||||
request));
|
||||
|
||||
// Clean up request
|
||||
|
||||
Reference in New Issue
Block a user