@ansaro/errors

0.2.2 • Public • Published

Errors

Report errors to Sentry

yarn add @ansaro/errors

Usage

Set environment variable SENTRY_DSN to your project's client key (DSN).

reportError is an asynchronous function that takes two arguments:

  1. Error the error to report
  2. options an object of optional settings
const { reportError } = require("@ansaro/errors");

async function() {
  try {
    ...
  } catch(ex) {
    await reportError(ex, {
      tags: {
        service: "name-of-service"
      }
    })
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @ansaro/errors

Weekly Downloads

3

Version

0.2.2

License

ISC

Unpacked Size

4.31 kB

Total Files

4

Last publish

Collaborators

  • bgoldberg15
  • maxbeatty