mirror of https://github.com/calzoneman/sync.git
Wrap raw file HEAD check in try-catch in case of invalid URL
This commit is contained in:
parent
3d520ecf57
commit
d54707c9c7
|
@ -149,6 +149,8 @@ function testUrl(url, cb, params = { redirCount: 0, cookie: '' }) {
|
|||
if (cookie) {
|
||||
data.headers = { 'Cookie': cookie };
|
||||
}
|
||||
|
||||
try {
|
||||
var req = transport.request(data, function (res) {
|
||||
req.abort();
|
||||
|
||||
|
@ -211,6 +213,12 @@ function testUrl(url, cb, params = { redirCount: 0, cookie: '' }) {
|
|||
});
|
||||
|
||||
req.end();
|
||||
} catch (error) {
|
||||
LOGGER.error('Unable to make raw file probe request: %s', error.stack);
|
||||
cb("An unexpected error occurred while trying to process the link. " +
|
||||
"Try again, and contact support for further troubleshooting if the " +
|
||||
"problem continues.");
|
||||
}
|
||||
}
|
||||
|
||||
function readOldFormat(buf) {
|
||||
|
|
Loading…
Reference in New Issue