mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +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;
|
paramsSerializer?: (params: any) => string;
|
||||||
data?: any;
|
data?: any;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
|
timeoutErrorMessage?: string;
|
||||||
withCredentials?: boolean;
|
withCredentials?: boolean;
|
||||||
adapter?: AxiosAdapter;
|
adapter?: AxiosAdapter;
|
||||||
auth?: AxiosBasicCredentials;
|
auth?: AxiosBasicCredentials;
|
||||||
|
|||||||
+5
-1
@@ -88,7 +88,11 @@ module.exports = function xhrAdapter(config) {
|
|||||||
|
|
||||||
// Handle timeout
|
// Handle timeout
|
||||||
request.ontimeout = function handleTimeout() {
|
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));
|
request));
|
||||||
|
|
||||||
// Clean up request
|
// Clean up request
|
||||||
|
|||||||
Reference in New Issue
Block a user