📄 Improve error message for download timeout

This commit is contained in:
C-3PO 2018-11-16 03:10:17 +01:00
parent 758e69ba27
commit 4440917fc8
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -28,6 +28,8 @@ export default function downloadWithCurl({ host, path, tempFileName }: {host: st
spawnedProcess.on('exit', function(code) { spawnedProcess.on('exit', function(code) {
if (code === 0) { if (code === 0) {
resolve(tempFileName); resolve(tempFileName);
} else if (code === 28) {
reject(`Download speed too slow, will restart "${url}".`);
} else { } else {
reject(`Error in process:\n> curl ${parameters.join(' ')}\nNon-zero exit code ${code}.`); reject(`Error in process:\n> curl ${parameters.join(' ')}\nNon-zero exit code ${code}.`);
} }