Skip to content

Commit

Permalink
Include post HTML in error reports from post parsing. #862
Browse files Browse the repository at this point in the history
  • Loading branch information
ccd0 committed Jul 26, 2019
1 parent d87dc0a commit 5631d28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/General/Index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/main/Main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down Expand Up @@ -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) ->
Expand Down

0 comments on commit 5631d28

Please # to comment.