-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Maybe I'm missing something, but it seems to me that if I run redis:connect() when the redis db is down, the client process crashes (i.e. some linked process seems to send an exit signal from redis_client:init/1). This can't be caught with try/catch and the only way seems to be trapexit. This seems weird because the success case return value is {ok, Connection} which would make me expect the error return to be {error, Something}.
Am I making some dumb error? Is there a less drastic way to handle the situation? I'm not that fluent in Erlang so I could be overlooking something.
I opened an Erlang-questions thread starting here:
http://erlang.org/pipermail/erlang-questions/2013-June/074093.html
and a couple people suggested that connection failure should return an error code instead of craashing.
Thanks.