Add ffmpeg error log for request failure case

This commit is contained in:
Calvin Montgomery 2017-06-17 09:45:47 -07:00
parent 6633e23aa3
commit 6161f4ad44
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,8 @@ function translateStatusCode(statusCode) {
"the file to be downloaded."; "the file to be downloaded.";
case 404: case 404:
return "The requested link could not be found (404)."; return "The requested link could not be found (404).";
case 410:
return "The requested link does not exist (410 Gone).";
case 500: case 500:
case 503: case 503:
return "The website hosting the audio/video link encountered an error " + return "The website hosting the audio/video link encountered an error " +
@ -119,6 +121,7 @@ function testUrl(url, cb, redirCount) {
}); });
req.on("error", function (err) { req.on("error", function (err) {
LOGGER.error("Error sending preflight request: %s (link: %s)", err.message, url);
cb("An unexpected error occurred while trying to process the link. " + cb("An unexpected error occurred while trying to process the link. " +
"Try again, and contact support for further troubleshooting if the " + "Try again, and contact support for further troubleshooting if the " +
"problem continues." + (!!err.code ? (" Error code: " + err.code) : "")); "problem continues." + (!!err.code ? (" Error code: " + err.code) : ""));