-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
logError
method and reportButton
option
- Loading branch information
1 parent
b763595
commit f15bb29
Showing
4 changed files
with
115 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
const electron = require('electron'); | ||
const {openNewGitHubIssue, debugInfo} = require('electron-util'); | ||
const unhandled = require('.'); | ||
|
||
unhandled({ | ||
showDialog: true, | ||
reportButton: error => { | ||
openNewGitHubIssue({ | ||
user: 'sindresorhus', | ||
repo: 'electron-unhandled', | ||
body: `\`\`\`\n${error.stack}\n\`\`\`\n\n---\n\n${debugInfo()}` | ||
}); | ||
} | ||
}); | ||
|
||
let mainWindow; | ||
|
||
(async () => { | ||
await electron.app.whenReady(); | ||
|
||
mainWindow = new electron.BrowserWindow(); | ||
mainWindow.loadURL('https://google.com'); | ||
|
||
unhandled.logError(new Error('Test')); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters