From f987299a5d5a3e42ce96be5e29454b9c37576ed9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 15 Apr 2013 23:01:08 +0100 Subject: [PATCH] catch error on export --- src/node/utils/Abiword.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js index 92520343..498583c9 100644 --- a/src/node/utils/Abiword.js +++ b/src/node/utils/Abiword.js @@ -127,19 +127,21 @@ else doConvertTask = function(task, callback) { abiword.stdin.write("convert " + task.srcFile + " " + task.destFile + " " + task.type + "\n"); - //create a callback that calls the task callback and the caller callback stdoutCallback = function (err) { callback(); console.log("queue continue"); - task.callback(err); + try{ + task.callback(err); + }catch(e){ + console.error("Abiword File failed to convert", e); + } }; }; //Queue with the converts we have to do var queue = async.queue(doConvertTask, 1); - exports.convertFile = function(srcFile, destFile, type, callback) { queue.push({"srcFile": srcFile, "destFile": destFile, "type": type, "callback": callback});