<div dir="ltr">Thanks!<div><br></div><div>I would have prefered to _not_ have to set unsafe, as it would be great if DBIC continued to handle exceptions internally as always, but just didn&#39;t pass the exception out after catching and handling it internally.<div><div><br></div><div>And I appreciate the &#39;<font face="arial, sans-serif"><span style="font-size:12.7272720336914px">architecturally unsound&#39; warning, and would agree in general. The only reason we&#39;re doing it this way is that we already have exception handling built in to the application. The idea here is not to just skip handling exceptions, but rather automate </span>propagating<span style="font-size:12.7272720336914px"> exceptions up to the application level, without having to hand-wrap all calls in eval. So if handle_error in DBI calls our applications add_error() (_without_ blocking or altering DBIC&#39;s), then the die on call is redundant, as the apps existing error handling will pick it up.</span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px">Actually, if you wanted to encourage die or handle as an explicit decision and still discourage not handling it at all, perhaps a new optional argument to connect to provide a callback for external error handling, which when provided sets DBIC to not </span>propagate<span style="font-size:12.7272720336914px"> fatal errors to the application? exception_action seemed to come close, but was </span>triggered<span style="font-size:12.7272720336914px"> too often and did not suppress the die.</span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px">Please feel free to email me directly if there is anything I can do to help or questions I can answer. I&#39;d also of course be happy to test any updates.</span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px">-Cheers,</span></font></div><div><font face="arial, sans-serif"><span style="font-size:12.7272720336914px">Sean</span></font></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 12:01 PM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/15/2014 04:55 PM, Sean Quinlan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The end result I want is to not have to wrap every update / insert / etc<br>
with an eval.<br>
<br>
I have no problem if DBIC internals use exception-based control<br>
internally. I just want to optionally have it not bubble up to the level<br>
of my application. It would be far more elegant if I could have DBIC<br>
play nicely with our applications exception handling, rather than have<br>
to insulate every usage manually.<br>
<br>
</blockquote>
<br></span>
This is a reasonable (albeit architecturally unsound) request. If the &#39;unsafe&#39; handling is requested everything not happening in a transaction should indeed not result in exceptions.<br>
<br>
In order to go forward with this I will need a modest set of lives_ok checks for various operations. The actual implementation will be more involved and will likely be carried out by me or another core contrib. For a concise test example, take a look at<br>
<a href="https://github.com/dbsrgits/dbix-class/blob/current/for_cpan_index/t/schema/anon.t" target="_blank">https://github.com/dbsrgits/<u></u>dbix-class/blob/current/for_<u></u>cpan_index/t/schema/anon.t</a><br>
<br>
Let me know if you have any further questions<br>
<br>
Cheers!<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-<u></u>bin/mailman/listinfo/dbix-<u></u>class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/<u></u>repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" target="_blank">http://www.grokbase.com/group/<u></u>dbix-class@lists.scsys.co.uk</a><br>
</div></div></blockquote></div><br></div>