From 430c5e7ae99fb31ec915320422ecec55929c19a6 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Wed, 29 Aug 2018 14:36:38 -0700 Subject: [PATCH] Move corrupt NEFs and continue processing Signed-off-by: James Ketrenos --- server/scanner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/scanner.js b/server/scanner.js index a7213dd..465334f 100644 --- a/server/scanner.js +++ b/server/scanner.js @@ -241,7 +241,8 @@ function convertNefToJpg(path, file) { ufraw.on('exit', function(code, signal) { if (signal || code != 0) { - return reject("UFRAW for " + path + "/" + file + " returned an error: " + code + "\n" + signal + "\n" + error + "\n"); + console.error("UFRAW for " + path + "/" + file + " returned an error: " + code + "\n" + signal + "\n" + error + "\n"); + return moveCorrupt(path, file); } return mkdirPromise(path + "/raw").then(function() { fs.rename(path + "/" + file, path + "/raw/" + file, function(err) { @@ -410,6 +411,8 @@ function triggerWatcher() { processQueue.push([ path, file, created, albumId ]); }); }); + }).catch(function() { + console.warn("Continuing file processing."); }); }, { concurrency: 1