🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

error-trap

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

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.

0.1.0
latest
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 16 Jul 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