From 2c107383314842e248dfdb31c5b07cc6305386c9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 27 Dec 2014 17:25:45 +0100 Subject: [PATCH] fix warning message --- src/node/handler/ImportHandler.js | 8 +++----- src/node/utils/ImportHtml.js | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 55915d760..361fc9a2a 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -196,11 +196,9 @@ exports.doImport = function(req, res, padId) function(callback) { var fileEnding = path.extname(srcFile).toLowerCase(); if (abiword || fileEnding == ".htm" || fileEnding == ".html") { - try{ - importHtml.setPadHTML(pad, text); - }catch(e){ - apiLogger.warn("Error importing, possibly caused by malformed HTML"); - } + importHtml.setPadHTML(pad, text, function(e){ + if(e) apiLogger.warn("Error importing, possibly caused by malformed HTML"); + }); } else { pad.setText(text); } diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 3ca91caf4..64f41e8fd 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -89,7 +89,7 @@ function setPadHTML(pad, html, callback) apiLogger.debug('The changeset: ' + theChangeset); pad.setText(""); pad.appendRevision(theChangeset); - callback(); + callback(null); } exports.setPadHTML = setPadHTML;