Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "Error opening app" dialog #5610

Merged
merged 6 commits into from May 24, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions default_app/main.js
Expand Up @@ -253,13 +253,16 @@ function loadApplicationPackage (packagePath) {
} catch (e) {
if (e.code === 'MODULE_NOT_FOUND') {
app.focus()
dialog.showErrorBox(
'Error opening app',
'The app provided is not a valid Electron app, please read the docs on how to write one:\n' +
`https://github.com/electron/electron/tree/v${process.versions.electron}/docs

${e.toString()}`
)
dialog.showMessageBox({
message: 'Error opening app',
detail: 'Unable to open or find an Electron app. Click to learn more on how to write an app.\n\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can now drop the Click to learn more on how to write an app. piece of this message.

`${e.toString()}`,
buttons: ['Learn More', 'OK']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want to have to OK button be the default selected button instead of Learn More, seems like a more common pattern since the person might know what to do just by seeing the error message and might not want to always learn more.

}, (response) => {
if (response === 0) {
shell.openExternal(`https://github.com/electron/electron/tree/v${process.versions.electron}/docs`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to change this URL to http://electron.atom.io/docs now

}
})
process.exit(1)
} else {
console.error('App threw an error when running', e)
Expand Down