From 8a8ed0a93271b994252a4f826bc37f5d0ab41f87 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 12 Aug 2017 13:20:44 -0700 Subject: [PATCH] ffmpeg: better error messages for ECONNREFUSED and ENOTFOUND --- src/ffmpeg.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index 7e311ad2..727ef041 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -123,6 +123,12 @@ function testUrl(url, cb, redirCount) { cb("The remote server provided an invalid SSL certificate. Details: " + err.reason); 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);