`rescue`ing an exception defined in a third-party module

38 views
Skip to first unread message

Srinivas JONNALAGADDA

unread,
Jul 2, 2016, 1:11:10 PM7/2/16
to elixir-lang-talk
Hello,

        I am trying `rescue` a `Redix.Error` in my code.  The normal `try`/`rescue` syntax is not catching it the way it rescues an error from my own module.  Is there a different way to rescue exceptions from third-party modules?  I am sure I am doing something very dumb.  Thanks.

                                       -- 0|0

PS: Elixir 1.3.0, Erlang 19, Ubuntu 16.04 amd64

Srinivas JONNALAGADDA

unread,
Jul 2, 2016, 2:02:51 PM7/2/16
to elixir-lang-talk
        The issue seems to occur only when my code is placed in a GenServer's worker module.  Evidently, exceptions work in a different way inside GenServer.  What am I missing?  Thanks.

                                        -- 0|0

Srinivas JONNALAGADDA

unread,
Jul 2, 2016, 2:14:25 PM7/2/16
to elixir-lang-talk
        Apologies!  Late night effect!

        There was one path in the GenServer module code that let the exception uncaught.  That path was terminating the worker process.  Apologies again!

                                        -- 0|0
Reply all
Reply to author
Forward
0 new messages