ffmpeg: better error messages for ECONNREFUSED and ENOTFOUND

This commit is contained in:
Calvin Montgomery 2017-08-12 13:20:44 -07:00
parent d0c1e8cbd9
commit 8a8ed0a932
1 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,12 @@ function testUrl(url, cb, redirCount) {
cb("The remote server provided an invalid SSL certificate. Details: " cb("The remote server provided an invalid SSL certificate. Details: "
+ err.reason); + err.reason);
return; return;
} else if (err.code === 'ENOTFOUND') {
cb(`Unknown host "${err.hostname}". Please check that the link is correct.`);
return;
} else if (err.code === 'ECONNREFUSED') {
cb("The remote server refused the connection. Please check that the link is correct.");
return;
} }
LOGGER.error("Error sending preflight request: %s (link: %s)", err.message, url); LOGGER.error("Error sending preflight request: %s (link: %s)", err.message, url);