初始化环境文件
This commit is contained in:
11
node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js
generated
vendored
Normal file
11
node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export function requestTimeout(timeoutInMs = 0) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (timeoutInMs) {
|
||||
setTimeout(() => {
|
||||
const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
|
||||
timeoutError.name = "TimeoutError";
|
||||
reject(timeoutError);
|
||||
}, timeoutInMs);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user