properly send the error
This commit is contained in:
parent
b072cda0d6
commit
c9d0ffa50a
1 changed files with 8 additions and 7 deletions
|
@ -110,14 +110,15 @@ class DownloadController {
|
|||
|
||||
return youtubedl.exec(data.url, ['--format=mp4', '-o', altFolder], {}, function(err, output) {
|
||||
if (err) {
|
||||
return view.render(page, {
|
||||
console.error(err);
|
||||
return response.send(view.render(page, {
|
||||
title: title,
|
||||
viewCounter: viewCounter,
|
||||
file: files,
|
||||
day: day, month: month, announcement: announcement ,
|
||||
error: true,
|
||||
errormsg: 'bruh moment, you didin\'t input a valid link.'
|
||||
});
|
||||
errormsg: err
|
||||
}));
|
||||
}
|
||||
|
||||
return response.attachment(altFolder);
|
||||
|
@ -127,15 +128,15 @@ class DownloadController {
|
|||
let video = youtubedl(data.url, ['--format=mp4', '-f', option]);
|
||||
|
||||
video.on('error', function(err) {
|
||||
//console.error(err);
|
||||
return view.render(page, {
|
||||
console.error(err);
|
||||
return response.send(view.render(page, {
|
||||
title: title,
|
||||
viewCounter: viewCounter,
|
||||
file: files,
|
||||
day: day, month: month, announcement: announcement ,
|
||||
error: true,
|
||||
errormsg: 'bruh moment, you didin\'t input a valid link.'
|
||||
});
|
||||
errormsg: err
|
||||
}));
|
||||
})
|
||||
|
||||
let ext;
|
||||
|
|
Loading…
Reference in a new issue