diff --git a/src/google2vtt.js b/src/google2vtt.js index a081a086..293b64ac 100644 --- a/src/google2vtt.js +++ b/src/google2vtt.js @@ -167,7 +167,15 @@ function clearOldSubtitles() { if (stats.mtime.getTime() < Date.now() - ONE_DAY) { LOGGER.info('Deleting old subtitle file: ' + file); - fs.unlink(path.join(subtitleDir, file)); + fs.unlink(path.join(subtitleDir, file), error => { + if (error) { + LOGGER.error( + 'Failed to remove file %s: %s', + file, + error.stack + ); + } + }); } }); });