📄 Improve error message for download timeout
This commit is contained in:
parent
758e69ba27
commit
4440917fc8
1 changed files with 2 additions and 0 deletions
|
@ -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}.`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue