From 4440917fc83d12fa85ed8ccf8f8855fd7eed7097 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 16 Nov 2018 03:10:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=84=20Improve=20error=20message=20for?= =?UTF-8?q?=20download=20timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdn/downloadWithCurl.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cdn/downloadWithCurl.ts b/src/cdn/downloadWithCurl.ts index 5fd38df..dd830e2 100644 --- a/src/cdn/downloadWithCurl.ts +++ b/src/cdn/downloadWithCurl.ts @@ -28,6 +28,8 @@ export default function downloadWithCurl({ host, path, tempFileName }: {host: st spawnedProcess.on('exit', function(code) { if (code === 0) { resolve(tempFileName); + } else if (code === 28) { + reject(`Download speed too slow, will restart "${url}".`); } else { reject(`Error in process:\n> curl ${parameters.join(' ')}\nNon-zero exit code ${code}.`); }