node.js - Error Handler Nodejs Redis Connect-domain fail -


i tried use connect-domain handling error. in cases ok, fail redis callback. how fix this?

here's app

var http = require('http'); var express = require('express'); var connectdomain = require('connect-domain'); var redis = require("redis").createclient();  var app = express(); app.use(connectdomain());  app.get('/', function (req, res) {     throw new error("handler ok"); });  app.get('/error', function (req, res) {     redis.get("akey", function(err, reply) {         throw new error("handler error");         res.end("ok");     }); });  app.use(function (err, req, res, next) {     res.end(err.message); });  http.createserver(app).listen(8989, function() {     console.log("express server started "); }); 

i use nodejs 0.8.16, modules latest

not sure if domain should catching or not - can capture redis errors setting error handler, this:

// handle redis connection temporarily going down without app crashing redisclient.on("error", function(err) {     console.error("error connecting redis", err); }); 

while connection broken handler keep getting called redis tries reconnect. if it's successful come online on it's own.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -