You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Am I using the wrong approach?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: