[erlang-questions] handling crash on db connect

Paul Rubin paul@REDACTED
Wed Jun 5 22:59:20 CEST 2013

I'm using gar1t's redis driver and find that if the redis server is
running, redis:connect() causes the client to crash.  try/catch doesn't
handle it, so I think it's linking some other process which then crashes
and propagates the exit.

What's the right way to handle the crash, in order to report some
reasonable error and/or do a sleep/retry loop?  One obvious way is
trapexit() and explicitly handle the exit signal, but I have the impression
that this would be overly drastic in Erlang.  Connection failure to a db
should be a fairly routine error condition, so I feel like there's
something I'm missing.

Any advice?  Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130605/ac69821c/attachment.htm>

More information about the erlang-questions mailing list