Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browser-exception-collector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-exception-collector

An exception collector for browser

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

browser-exception-collector (WIP)

npm version

An exception collector for browser

Installation

# npm
npm install browser-exception-collector

# yarn
yarn add browser-exception-collector

Usage

import { ExceptionCollector } from 'browser-exception-collector';

const collector = new ExceptionCollector();

collector.onError(error => {
  console.error('onError', error);
  console.log('onError', JSON.parse(error.toJSON()));
});

collector.onUnhandledRejection(error => {
  console.error('onUnhandledRejection', error);
  console.log('onUnhandledRejection', JSON.parse(error.toJSON()));
});

APIs

  • ExceptionCollector
    • new ExceptionCollector(options)
      • options.debug
    • ExceptionCollector.prototype.dispose()
    • ExceptionCollector.prototype.on(type, handler)
    • ExceptionCollector.prototype.onError(handler)
    • ExceptionCollector.prototype.onUnhandledRejection(handler)
    • ExceptionCollector.prototype.onRejectionHandled(handler)
  • CustomError
    • new CustomError(message, errorInit)
    • CustomError.prototype.toString()
    • CustomError.prototype.toJSON()

License

MIT © Qingrong Ke

Keywords

FAQs

Package last updated on 23 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc