node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Callstack-cleaner Build Status

Clean the callstack from error messages

Getting Started

Install the module with: npm install callstack-cleaner

var callstack_cleaner = require('callstack-cleaner');
var _err = new Error("plop");
var err = new Error("Redis reply parser error: " + _err.stack); // see `Why` section 
err = callstack_cleaner(err); // "Redis reply parser error: Error: plop" 

Why ??

node_redis emit parser error in a weird way:

this.reply_parser.on("error", function (err) {
    self.emit("error", new Error("Redis reply parser error: " + err.stack));

Callstack-cleaner remove the callstack from the emitted error.message.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History


Initial version.


Copyright (c) 2012 Francois-Guillaume Ribreau ( Licensed under the MIT license.