use error in both reject and destroy

This commit is contained in:
Andrei Kashchikhin committed 2025-09-24 17:05:25 +02:00
1 parent fc83cc9f2c
commit 9f7af6f342
1 file changed
+3 -4
+3 -4
View File
@@ -79,10 +79,9 @@ export async function streamExtractExternal(
return new Promise((resolve, reject) => {
const timerFn = (): void => {
response.message.destroy(
new Error(`Blob storage chunk did not respond in ${timeout}ms`)
)
reject(`Blob storage chunk did not respond in ${timeout}ms`)
const timeoutError = new Error(`Blob storage chunk did not respond in ${timeout}ms`)
response.message.destroy(timeoutError)
reject(timeoutError)
}
const timer = setTimeout(timerFn, timeout)