1.0.0 • Published 8 years ago

error-parser v1.0.0

Weekly downloads
3
License
GNU
Repository
github
Last release
8 years ago

error-parser

Makes errors pretty & mostly readable

Usage

See tests for examples/use-cases.

npm install error-parser
var errorParser = require('error-parser');

// Some sample error
var error = new Error('Sample error');

var parsedError = errorParser(error);

console.log(parsedError);
/**
{
  message: 'Sample error',
  stack: {
    file: 'abc.js',
    line: 10,
    column: 2
  }
}
**/


/** Another Use-case - uncaughtException **/

process.on('uncaughtException', function(err) {
  console.log( errorParser(err) );
});

randomVar = randomVar + 1;

/**
{
  message: 'randomVar is not defined',
  stack: {
    file: 'test/uncaught_exception.js',
     line: '8',
     column: '13'
    }
  }
**/
1.0.0

8 years ago

0.1.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago