Skip to content

Catch unhandled errors and promise rejections in your Electron app

License

Notifications You must be signed in to change notification settings

54leibo/electron-unhandled

 
 

Repository files navigation

electron-unhandled Build Status

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 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

License

MIT © Sindre Sorhus

About

Catch unhandled errors and promise rejections in your Electron app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%