From 118c66e5d0248d2025022398edf274e7a7fa094e Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 10 Jul 2021 23:22:15 -0400 Subject: [PATCH] HTML import: Improve log message for invalid HTML --- src/node/utils/ImportHtml.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 26e541fe1..13fb74795 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -46,11 +46,9 @@ exports.setPadHTML = async (pad, html) => { try { // we use a try here because if the HTML is bad it will blow up cc.collectContent(document.body); - } catch (e) { - apiLogger.warn('HTML was not properly formed', e); - - // don't process the HTML because it was bad - throw e; + } catch (err) { + apiLogger.warn(`Error processing HTML: ${err.stack || err}`); + throw err; } const result = cc.finish();