In my application im using redis database with node.js.Now i want to build error capture module .How can i capture error in redis.Using Airbrake(https://github.com/felixge/node-airbrake) we can capture error but how can i do that on my own using redis in node.js.
If you look at the code for node-airbrake, you'll notice this:
Airbrake.prototype.handleExceptions = function() {
var self = this;
process.on('uncaughtException', function(err) {
self._onError(err, true)
});
};
So, you could implement your own uncaughtException handler (although some say that doing so is bad form, but that's another discussion) and store your errors in Redis.