How to use the honeybadger-js.notify function in honeybadger-js

To help you get started, we’ve selected a few honeybadger-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github influxdata / influxdb / ui / src / shared / utils / errors.ts View on Github external
}

  const context = {
    ...additionalContext,
    ...getUserFlags(),
  }

  let options: HoneyBadgerAdditionalOptions = {}
  if (additionalOptions) {
    options = {...additionalOptions}

    delete options.context // already included in the above context object
  }

  if (CLOUD) {
    HoneyBadger.notify(error, {context, ...options})

    let errorType = 'generic (untagged) error'
    if (options.name) {
      errorType = options.name
    } else if (options.component) {
      errorType = options.component
    }

    event('ui error', {error: errorType}, {errorCount: 1})
  } else {
    console.error(error)
  }
}

honeybadger-js

A JavaScript library for integrating apps with the Honeybadger Rails Error Notifier.

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages