var Sentinel = sentinel.Sentinel(endpoints);var client = Sentinel.createClient(REDIS_SENTINEL_MASTER_NAME, {role: 'master'});
When Redis is not running, or it is misconfigured, your library will throw an error - Error: Failed to find a sentinel from the endpoints
However, the error is not fatal and my server keeps running.
(1) I want to trap that error and decide if I should kill my server.
(2) I want to find out where in my program the error is occurring; as of now, it's hard to track down.
In most sophisticated languages, errors will "bubble up" if you enclose them with a try/catch block:
try{
var Sentinel = sentinel.Sentinel(endpoints);
var client = Sentinel.createClient(REDIS_SENTINEL_MASTER_NAME, {role: 'master'});
}
catch(e){
throw e;
}
but I am unable to trap the errors. Your library throws the error internally, but doesn't give me enough information to trap the error.
If I have these two lines of code:
var Sentinel = sentinel.Sentinel(endpoints);
var client = Sentinel.createClient(REDIS_SENTINEL_MASTER_NAME, {role: 'master'});
When Redis is not running, or it is misconfigured, your library will throw an error -
Error: Failed to find a sentinel from the endpoints
However, the error is not fatal and my server keeps running.
(1) I want to trap that error and decide if I should kill my server. (2) I want to find out where in my program the error is occurring; as of now, it's hard to track down.
In most sophisticated languages, errors will "bubble up" if you enclose them with a try/catch block:
but I am unable to trap the errors. Your library throws the error internally, but doesn't give me enough information to trap the error.
Am I using the wrong approach?