HTML import: Improve log message for invalid HTML

pull/4683/head
Richard Hansen 2021-07-10 23:22:15 -04:00
parent c816c20bc7
commit 118c66e5d0
1 changed files with 3 additions and 5 deletions

View File

@ -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();