Skip to content

Commit 8aafe46

Browse files
authored
fix: gui error report title (#2011)
1 parent 744ef70 commit 8aafe46

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/dialogs/errors.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ const path = require('path')
33
const i18n = require('i18next')
44
const dialog = require('./dialog')
55

6-
const issueTemplate = (e) => `Please describe what you were doing when this error happened.
6+
const issueTitle = (e) => {
7+
const es = e.stack ? e.stack.toString() : 'unknown error, no stacktrace'
8+
const firstLine = es.substr(0, Math.min(es.indexOf('\n'), 72))
9+
return `[gui error report] ${firstLine}`
10+
}
11+
12+
const issueTemplate = (e) => `👉️ Please describe what you were doing when this error happened.
713
814
**Specifications**
915
@@ -21,7 +27,7 @@ ${e.stack}
2127

2228
let hasErrored = false
2329

24-
const generateErrorIssueUrl = (e) => `https://github.com/ipfs-shipyard/ipfs-desktop/issues/new?labels=need%2Ftriage&template=bug_report.md&title=[gui%20error%20report]&body=${encodeURI(issueTemplate(e))}`.substring(0, 1999)
30+
const generateErrorIssueUrl = (e) => `https://github.com/ipfs-shipyard/ipfs-desktop/issues/new?labels=kind%2Fbug%2C+need%2Ftriage&template=bug_report.md&title=${encodeURI(issueTitle(e))}&body=${encodeURI(issueTemplate(e))}`.substring(0, 1999)
2531

2632
function criticalErrorDialog (e) {
2733
if (hasErrored) return

0 commit comments

Comments
 (0)