JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q27981F
  • License ISC

Provied a single callback that runs when browser throws any uncaught exception

Package Exports

  • catcherr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (catcherr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Catcherr

Did you ever deploy a web app, only to discover that the Grate Safari throws an exception, and you have no idea why?
Catcherr catches those err's for you.

Installation

Using npm:

$ npm install catcherr

In a browser, copying catcherr.js:

<script src="./catcherr.js" type="module"></script>

Usage

There are two options:

  • Using es6 imports
<script type="module">
    import catcher from "./catcherr.js"
    catcher(error => console.log("Caught global error: ", error))
</script>
  • Importing in html
<script src="catcherr.js" type="module"></script>
<script>
    // Will be called when error is uncaught
    window.onError = error => console.log("Caught global error: ", error)
</script>