Socket
Socket
Sign inDemoInstall

error-trap

Package Overview
Dependencies
72
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    error-trap

This module automatically injects code into every HTML page that makes a WebSocket connection back to the server and sends the server information about any uncaught errors. It hooks into browser functionality such as addEventListener() and setTimeout() to get complete stack traces but falls back to a window.onerror handler so it doesn't miss anything.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
8.28 MB
Created
Weekly downloads
 

Readme

Source

Real-time Error Trap

This module automatically injects code into every HTML page that makes a WebSocket connection back to the server and sends the server information about any uncaught errors. It hooks into browser functionality such as addEventListener() and setTimeout() to get complete stack traces but falls back to a window.onerror handler so it doesn't miss anything.

Usage

var errorTrap = require('error-trap');
var connect = require('connect');
var app = connect();
var server = require('http').createServer(app);

app.use(errorTrap({
  server: server,
  onerror: function(message) {
    console.log({
      text: message.text,
      date: new Date(message.time),
      method: message.method
    });
  }
}));
app.use(connect.static('www'));
server.listen(8000);

FAQs

Last updated on 16 Jul 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc