From 5631d2877dbc10fe46e1c151b98a351ce3ec4428 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 26 Jul 2019 09:26:49 -0700 Subject: [PATCH] Include post HTML in error reports from post parsing. #862 --- src/General/Index.coffee | 5 ++++- src/main/Main.coffee | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 107c11821..3127ee1e6 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -721,7 +721,8 @@ Index = thread.setPage(Index.threadPosition[ID] // Index.threadsNumPerPage + 1) else obj = Index.parsedThreads[ID] - OP = new Post g.SITE.Build.post(obj), thread, g.BOARD + opRoot = g.SITE.Build.post(obj) + OP = new Post opRoot, thread, g.BOARD OP.filterResults = obj.filterResults newPosts.push OP @@ -733,6 +734,7 @@ Index = errors.push message: "Parsing of Thread No.#{thread} failed. Thread will be skipped." error: err + html: opRoot?.outerHTML Main.handleErrors errors if errors if withReplies @@ -763,6 +765,7 @@ Index = errors.push message: "Parsing of Post No.#{data.no} failed. Post will be skipped." error: err + html: node?.outerHTML $.add thread.nodes.root, nodes Main.handleErrors errors if errors diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 0fbf15c65..d1f0d2682 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -382,6 +382,7 @@ Main = errors.push message: "Parsing of Post No.#{postRoot.id.match(/\d+/)} failed. Post will be skipped." error: err + html: postRoot.outerHTML return addThreads: (records) -> @@ -458,6 +459,7 @@ Main = errors.push message: "Parsing of Catalog Thread No.#{(threadRoot.dataset.id or threadRoot.id).match(/\d+/)} failed. Thread will be skipped." error: err + html: threadRoot.outerHTML return addCatalogThreads: (records) ->