Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
feat(ui): prefill gh uncaught error issues
Browse files Browse the repository at this point in the history
resolves #1828
  • Loading branch information
korhaliv committed Aug 14, 2019
1 parent 05b8ea5 commit 033018f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion renderer/components/App/AppErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export default class AppErrorBoundary extends Component {
children: PropTypes.node,
}

static submitErrorIssue(error) {
const url = window.Zap.createZapIssueTemplate('Unhandled React exception', error.stack, [
'type: bug 🐛',
])
window.Zap.openExternal(url)
}

constructor(props) {
super(props)
this.state = { error: null }
Expand All @@ -22,7 +29,7 @@ export default class AppErrorBoundary extends Component {
const { error } = this.state
const { children } = this.props
if (error) {
return <AppCrashedDialog error={error} isOpen />
return <AppCrashedDialog error={error} isOpen onSubmit={AppErrorBoundary.submitErrorIssue} />
}

return children
Expand Down

0 comments on commit 033018f

Please # to comment.