Skip to content

Commit 6580094

Browse files
authored
docs: link to faq on known error (#2827)
docs: link to faq if known error we have the same errors reported over and over again and there is FAQ for them. this ensures these errors are not reported anymore, but user is routed to FAQ entry instead, to self-service
1 parent 7aaa161 commit 6580094

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/dialogs/errors.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,20 @@ ${e.stack}
2828

2929
let hasErrored = false
3030

31-
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)
31+
function generateErrorIssueUrl (e) {
32+
// Check if error is one we have FAQ for
33+
if (e && e.stack) {
34+
const stack = e.stack
35+
switch (true) {
36+
case stack.includes('repo.lock'):
37+
return 'https://github.com/ipfs/ipfs-desktop?tab=readme-ov-file#i-got-a-repolock-error-how-do-i-resolve-this'
38+
case stack.includes('Error fetching'):
39+
return 'https://github.com/ipfs/ipfs-desktop?tab=readme-ov-file#i-got-a-network-error-eg-error-fetching-what-should-i-do'
40+
}
41+
}
42+
// Something else, prefill new issue form with error details
43+
return `https://github.com/ipfs/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)
44+
}
3245

3346
/**
3447
* This will fail and throw another application error if electron hasn't booted up properly.

0 commit comments

Comments
 (0)