springbokjs-errors

2.1.0 • Public • Published

springbokjs-errors NPM version Drone.io Status

Parse an error with its stack trace, apply source maps and render it in console or in html

Use

For console

var stackParser = require('springbokjs-stack-trace');

try {
    //...
} catch (err) {
    console.error(stackParser.parse(err).toString());
}

Html rendering

var HtmlStackRenderer = require('springbokjs-stack-trace/lib/HtmlRenderer');
var htmlStackRenderer = new HtmlStackRenderer();

function(req, res) {
    try {
        //...
    } catch (err) {
        res.send(500, htmlStackRenderer.render(err));
    }
}

See the auto-generated docs

Readme

Keywords

Package Sidebar

Install

npm i springbokjs-errors

Weekly Downloads

6

Version

2.1.0

License

MIT

Last publish

Collaborators

  • churpeau