[erlang-questions] Mismatch between dbg output and source code

Björn Gustavsson bjorn@REDACTED
Wed Apr 15 06:31:47 CEST 2015


On Tue, Apr 14, 2015 at 10:28 PM, Juan Puig Martínez <juan@REDACTED> wrote:
> I’m debugging a cause clause exception thrown inside the following function:
>
> create_nonce(DeviceId, Reason, Details, Message, Req) ->

What is the value of Reason passed into the function?

>     case tmc_nonce:get_nonce(DeviceId) of
>         {error, memcached_unavailable = Reason} ->

This clause will only be executed if the value of Reason
given as a function argument is memcached_unavailable.

You probably want to change the line to something like:

         {error, memcached_unavailable = EReason} ->

>             (…);
>         {error, Reason} ->

Same problem here.

>             (…);
>         {ok, Nonce} ->
>             (…)
>     end.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list