Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Commit

Permalink
Improved error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
corpix committed Mar 4, 2012
1 parent 53191ec commit 2fe8145
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -37,7 +37,9 @@ ex.bind = function(app, opts){

app.error(function(err, req, res, next){
if(!err.name || err.name == 'Error' || !ex.hasOwnProperty(err.name)){
console.log('>>', err);
console.error(new Date().toLocaleString(), '>>', err);
console.log(err.stack);

if(req.xhr || opts.plain)
return res.send({ error: 'Internal error' }, 500);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Corpix <me@corpix.ru> (http://corpix.ru)",
"name": "express-errors",
"description": "Error handler",
"version": "0.0.9",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "git://github.com/corpix/express-errors.git"
Expand Down

0 comments on commit 2fe8145

Please sign in to comment.