在Electron应用中捕获未处理的错误和promise rejections
在Electron应用中捕获未处理的错误和promise rejections
Node.js 其它杂项
共297Star
详细介绍
Catch unhandled errors and promise rejections in your Electron app
You can use this module directly in both the main and renderer process.
Install
$ npm install --save electron-unhandled
Usage
const unhandled = require('electron-unhandled');
unhandled();
API
unhandled([options])
You probably want to call this both in the main process and any renderer processes to catch all possible errors.
options
Type: Object
logger
Type: Function
Default: console.error
Custom logger that receives the error.
Can be useful if you for example integrate with Sentry.
showDialog
Type: boolean
Default: true
Present an error dialog to the user.
Related
- electron-config - Simple config handling for your Electron app or module
- electron-debug - Adds useful debug features to your Electron app
- electron-context-menu - Context menu for your Electron app
- electron-dl - Simplified file downloads for your Electron app
License
MIT © Sindre Sorhus