1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

improving th generation error handling

This commit is contained in:
Patrik J. Braun 2018-11-18 22:30:41 +01:00
parent 99b27a9a55
commit 7a322e2afa
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ export class ThumbnailGeneratorMWs {
await this.taskQue.execute(input);
return next();
} catch (error) {
return next(new ErrorDTO(ErrorCodes.THUMBNAIL_GENERATION_ERROR, 'Error during generating thumbnail: ' + input.mediaPath, error));
return next(new ErrorDTO(ErrorCodes.THUMBNAIL_GENERATION_ERROR, 'Error during generating thumbnail: ' + input.mediaPath, error.toString()));
}
}

View File

@ -59,7 +59,7 @@ export class VideoRendererFactory {
ffmpeg(input.mediaPath).ffprobe((err: any, data: FfprobeData) => {
if (!!err || data === null) {
return reject(err);
return reject(err.toString());
}
const ratio = data.streams[0].height / data.streams[0].width;
const command: FfmpegCommand = ffmpeg(input.mediaPath);
@ -68,7 +68,7 @@ export class VideoRendererFactory {
resolve();
})
.on('error', (e) => {
reject(e);
reject(e.toString());
})
.outputOptions(['-qscale:v 4']);
if (input.makeSquare === false) {