<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Good catch! I totally ignored that ‘Reason’ was passed from another context with different semantics.</div>
</div><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 14, 2015, at 9:31 PM, Björn Gustavsson <<a href="mailto:bjorn@erlang.org" class="">bjorn@erlang.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">On Tue, Apr 14, 2015 at 10:28 PM, Juan Puig Martínez <<a href="mailto:juan@layer.com" class="">juan@layer.com</a>> wrote:<br class=""><blockquote type="cite" class="">I’m debugging a cause clause exception thrown inside the following function:<br class=""><br class="">create_nonce(DeviceId, Reason, Details, Message, Req) -><br class=""></blockquote><br class="">What is the value of Reason passed into the function?<br class=""><br class=""><blockquote type="cite" class="">    case tmc_nonce:get_nonce(DeviceId) of<br class="">        {error, memcached_unavailable = Reason} -><br class=""></blockquote><br class="">This clause will only be executed if the value of Reason<br class="">given as a function argument is memcached_unavailable.<br class=""><br class="">You probably want to change the line to something like:<br class=""><br class="">         {error, memcached_unavailable = EReason} -><br class=""><br class=""><blockquote type="cite" class="">            (…);<br class="">        {error, Reason} -><br class=""></blockquote><br class="">Same problem here.<br class=""><br class=""><blockquote type="cite" class="">            (…);<br class="">        {ok, Nonce} -><br class="">            (…)<br class="">    end.<br class=""></blockquote><br class="">/Bjorn<br class="">-- <br class="">Björn Gustavsson, Erlang/OTP, Ericsson AB<br class=""></div></blockquote></div><br class=""></body></html>