Socket
Book a DemoInstallSign in
Socket

airbrake-notice

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

airbrake-notice

Easy creation of Airbrake (or errbit) error notifications from Node.js or the browser

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

AirbrakeNotice

Easy creation of Airbrake (or errbit) error notifications from Node.js or the browser

Usage examples

Node.js

  var AirbrakeNotice = require("airbrake-notice");
  var version = "2.3";
  var notice = AirbrakeNotice(version);
  var message = notice.create({
    "apiKey": 'app-key',
    "notifier": {
      "name": 'my-notifier',
      "version": '0.3',
      "url": 'http://my-notifier.com'
    },
    "error": {
      "class": "ReferenceError",
      "message": "novar is not defined",
      "backtrace": [
        {
          "file": 'foo.js',
          "number": 4,
          "method": "saySomething"
        },
        {
          "file": 'bar.js',
          "number": 29,
          "method": "sayNoVar"
        }
      ]
    },
    "request": {
      "url": "http://example.com/pages/some-page.html",
      "component": "my-component",
      "action": "RunExample",
      "cgiData": {
        "SERVER_NAME": "example.org",
        "HTTP_USER_AGENT": "Mozilla"
      }
    },
    "serverEnvironment": {
      "name": "production",
      "projectRoot": "pages/",
      "appVersion": "1.0/"
    }
  });

Returns the following (as string):

<?xml version="1.0" encoding="UTF-8"?>
<notice version="2.3">
  <api-key>d41d8cd98f00b204e9800998ecf8427e</api-key>
  <notifier>
    <name>my-notifier</name>
    <version>0.3</version>
    <url>http://my-notifier.com</url>
  </notifier>
  <error>
    <class>ReferenceError</class>
    <message>novar is not defined</message>
    <backtrace>
      <line method="saySomething" file="foo.js" number="">4</line>
      <line method="sayNoVar" file="bar.js" number="">29</line>
    </backtrace>
  </error>
  <request>
    <url>http://example.com/pages/some-page.html</url>
    <component>my-component</component>
    <action>RunExample</action>
    <cgi-data>example.org</cgi-data>
  </request>
  <server-environment>
    <project-root></project-root>
    <environment-name></environment-name>
    <app-version></app-version>
  </server-environment>
</notice>

Browser

  var notice = AirbrakeNotice("2.3")
  notice.create(/* data */);

Keywords

airbrake

FAQs

Package last updated on 17 Jan 2013

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.