Skip to content

Commit

Permalink
Show useful error modal if os docs dir is misconfigured
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIMkaRU committed Oct 16, 2024
1 parent 152d27c commit 039ad52
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/error-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,29 @@ const initLogger = () => {
if (message.level === 'error') {
const error = message.data.join(os.EOL)

if (/Failed to get 'documents' path/gi.test(error)) {
const title = 'The OS Documents directory has been misconfigured'
const msg = `\
This indicates that your OS \`Documents\` directory has been misconfigured.
Please, set it to a valid location or reset it to the default`

showModalDialog({
errBoxTitle: title,
errBoxDescription: msg,
mdIssue: msg,
alertOpts: {
icon: 'error',
title,
showConfirmButton: false,
hasNoParentWin: true
}
})
.then(() => { app.quit() })
.catch((err) => { console.error(err) })

return
}

/*
* Don't open a new issue when:
* - It can't download differentially it would fallback to full download
Expand Down

0 comments on commit 039ad52

Please sign in to comment.