Skip to content

Instantly share code, notes, and snippets.

@nex3
Created August 5, 2010 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nex3/510489 to your computer and use it in GitHub Desktop.
Save nex3/510489 to your computer and use it in GitHub Desktop.
var express = require("express");
var app = express.createServer();
app.error(function(err, req, res, next) {
console.log("In the error handler");
next(err, req, res);
});
app.get("/", function(req, res, next) {
setTimeout(function() {
next(new Error("OH NO"));
}, 10);
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment