Gathering detailed insights and metrics for electron-unhandled
Gathering detailed insights and metrics for electron-unhandled
Gathering detailed insights and metrics for electron-unhandled
Gathering detailed insights and metrics for electron-unhandled
Catch unhandled errors and promise rejections in your Electron app
npm install electron-unhandled
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
457 Stars
39 Commits
24 Forks
6 Watchers
1 Branches
10 Contributors
Updated on Jun 28, 2025
Latest Version
5.0.0
Package Id
electron-unhandled@5.0.0
Unpacked Size
11.27 kB
Size
4.18 kB
File Count
5
NPM Version
10.6.0
Node Version
18.20.2
Published on
May 01, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Catch unhandled errors and promise rejections in your Electron app
You can use this module directly in both the main and renderer process.
1npm install electron-unhandled
Requires Electron 30 or later.
1import unhandled from 'electron-unhandled'; 2 3unhandled();
You probably want to call this both in the main
process and any renderer
processes to catch all possible errors.
Note: At minimum, this function must be called in the main
process.
Type: object
Note: Options can only be specified in the main
process.
Type: Function
Default: console.error
Custom logger that receives the error.
Can be useful if you for example integrate with Sentry.
Type: boolean
Default: Only in production
Present an error dialog to the user.
Type: Function
Default: undefined
When specified, the error dialog will include a Report…
button, which when clicked, executes the given function with the error as the first argument.
1import unhandled from 'electron-unhandled'; 2import {openNewGitHubIssue, debugInfo} from 'electron-util'; 3 4unhandled({ 5 reportButton: error => { 6 openNewGitHubIssue({ 7 user: 'sindresorhus', 8 repo: 'electron-unhandled', 9 body: `\`\`\`\n${error.stack}\n\`\`\`\n\n---\n\n${debugInfo()}` 10 }); 11 } 12});
Example of how the GitHub issue will look like.
Log an error. This does the same as with caught unhandled errors.
It will use the same options specified in the unhandled()
call or the defaults.
1import {logError} from 'electron-unhandled'; 2 3logError(new Error('🦄'));
Type: Error
The error to log.
Type: object
Type: string
Default: ${appName} encountered an error
The title of the error dialog.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 8/30 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More