Include post HTML in error reports from callbacks. #862
This commit is contained in:
parent
7657ac94f3
commit
4977c80bf8
@ -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",
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user