<div dir="ltr"><div><div><div><div>So this makes sense now.<br><br>The value that lcb_get_last_error returns is only set if an error callback would have been called. However an error callback is only called if another callback handler (eg a get handler) isn't already set for that action. In this case the other handler (the get handler) is called and passed the error, which we store in last_error and the internal error value is never updated for lcb_get_last_error.<br>
<br></div>This makes it safe to just go off of last_error.<br><br></div>I've submitted a patch that makes this and other changes. Tracker ID <span>3611397 <a href="https://sourceforge.net/tracker/?func=detail&aid=3611397&group_id=232389&atid=1086412">https://sourceforge.net/tracker/?func=detail&aid=3611397&group_id=232389&atid=1086412</a><br>
<br></span></div><div><span>Glad to answer any questions or hear any input on the changes.<br></span></div><div><span><br></span></div><span>Regards,<br><br></span></div><span>Ryan<br></span><div><div><span><br><br></span></div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 10:25 AM, Ryan Bullock <span dir="ltr"><<a href="mailto:rrb3942@gmail.com" target="_blank">rrb3942@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Ok, I need to dig into this anyways so I will see what I can find and work up a patch based on that.<br>
<br></div><div>Regards,<br><br>Ryan<br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 7:41 AM, Vlad Paiu <span dir="ltr"><<a href="mailto:vladpaiu@opensips.org" target="_blank">vladpaiu@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div bgcolor="#ffffff" text="#000000">
Hi Ryan,<br>
<br>
Wondered about that myself when the module was built, about why they
would have two different mechanisms for reporting errors. I included
both just for the sake of reporting all errors, but didn't see the
lcb_get_last_error() triggering.<br>
I guess we need the help of some libcouchbase devs here, or dig into
the libcouchbase code to see when lcb_get_last_error() triggers and
error.<br>
<br>
Best Regards,<br>
<pre cols="72">Vlad Paiu
OpenSIPS Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a> </pre><div><div>
<br>
On 04/18/2013 12:54 AM, Ryan Bullock wrote:
</div></div><blockquote type="cite"><div><div>
<div dir="ltr">
<div>
<div>
<div>
<div>Hey all,<br>
<br>
</div>
I am doing some work with opensips + couchbase and have
started on a patchset for the opensips couchbase driver to
clean up a few things (better error outputs, etc) and make
some changes that we require before going production.<br>
<br>
</div>
One thing I am noticing are calls to lcb_get_last_error()
after every operation, even though the error on the callback
is being stored in last_error. In my quick testing the
response from lcb_get_last_error() seems to always be
success even if the operation failed (such as due to a
connection failure), last_error shows the correct failure.<br>
<br>
I am wondering if the checks to lcb_get_last_error could be
removed? Or are their instances where it would show an error
not caught by last_error? I don't see many uses of
lcb_get_last_error in the libcouchbase examples and they
seem to all go off the error in the callback. The benefit I
see is being able to more easily report useful and relevant
errors.<br>
<br>
</div>
Input welcome.<br>
<br>
</div>
Regards,<br>
<br>
Ryan<br>
<div>
<div><br>
<br>
</div>
</div>
</div>
</div></div><pre><fieldset></fieldset>
_______________________________________________
Devel mailing list
<a href="mailto:Devel@lists.opensips.org" target="_blank">Devel@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
</blockquote>
</div>
<br>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org" target="_blank">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>