Include post HTML in error reports from callbacks. #862

This commit is contained in:
ccd0 2016-05-04 14:19:51 -07:00
parent 7657ac94f3
commit 4977c80bf8
3 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@
"changelog": "https://github.com/ccd0/4chan-x/blob/master/CHANGELOG.md",
"issues": "https://gitreports.com/issue/ccd0/4chan-x",
"newIssue": "https://gitreports.com/issue/ccd0/4chan-x?issue_title=%title&details=%details",
"newIssueMaxLength": 8200,
"appid": "lacclbnghgdicfifcamcmcnilckjamag",
"chromeStoreID": "ohnjgmpcibpbafdlkimncjhflgedgpam",
"recaptchaKey": "6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc",

View File

@ -19,6 +19,7 @@ class Callbacks
errors.push
message: ['"', name, '" crashed on node ', @type, ' No.', node.ID, ' (', node.board, ').'].join('')
error: err
html: node.nodes?.root?.outerHTML
Main.handleErrors errors if errors

View File

@ -382,8 +382,11 @@ Main =
#{data.error}
#{data.error.stack?.replace(data.error.toString(), '').trim() or ''}
"""
details += "\n\n#{data.html}" if data.html
details = details.replace /file:\/{3}.+\//g, '' # Remove local file paths
details = details.trim()
url = "<%= meta.newIssue.replace('%title', '#{encodeURIComponent title}').replace('%details', '#{encodeURIComponent details}') %>"
url = url[...<%= meta.newIssueMaxLength %>]
<%= html('<span class="report-error"> [<a href="${url}" target="_blank">report</a>]</span>') %>
isThisPageLegit: ->