I can not catch exception<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><i>user error (SQLite3 returned ErrorConstraint while attempting to perform step.</i>)<br><div><i><br></i></div><div>I do it as:</div>

<div><i>res &lt;- runDB $ E.catch (insertBy offer) (\(e :: E.SomeException) -&gt; return $ Left undefined)<br></i><br><div class="gmail_quote">2011/4/26 Anton Cheshkov <span dir="ltr">&lt;<a href="mailto:acheshkov@gmail.com">acheshkov@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Ok.</div><div><br></div>I recompiled persistent with new changes. All works how i want and expect.<div>But now   <i>insertBy</i> function are not so safe as earlier. </div>

<div><br></div><div><i>The insertBy function</i> checks only unique constrains defined on yesod framework level via Unique... constructions  .</div>
<div>Now  <i>insertBy</i> function throws exception if we try to insert &#39;bad&#39; value to column with foreign constraint. </div><div><br></div><div>Please show me how to catch exception. </div><div>I think it would something like:</div>


<div><i><br></i></div><div><i>import qualified Control.Exception.Control as E</i></div><div><i>...</i></div><div><div><i>do</i></div><div><i>   res &lt;- runDB $ E.catch (insertBy offer) (\_ -&gt; return Left ())</i></div>


<div><br></div><div>But my exception handler is wrong. </div><div><br></div><div><br></div><div>Thanks.</div><div><div></div><div class="h5"><div><br><div class="gmail_quote">2011/4/26 Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info" target="_blank">greg@gregweber.info</a>&gt;</span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks!<div><br></div><div>Please send a pull request to Michael.<br><br><div class="gmail_quote"><div><div></div><div>


On Tue, Apr 26, 2011 at 5:58 AM, Anton Cheshkov <span dir="ltr">&lt;<a href="mailto:acheshkov@gmail.com" target="_blank">acheshkov@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>I have pushed branch to fix it. probably it should be helpful. <div><a href="https://github.com/acheshkov/persistent" target="_blank">https://github.com/acheshkov/persistent</a></div>






<div><br></div><div><a href="https://github.com/acheshkov/persistent" target="_blank"></a>Thanks.<div><div></div><div><br><br><div class="gmail_quote">2011/4/26 Anton Cheshkov <span dir="ltr">&lt;<a href="mailto:acheshkov@gmail.com" target="_blank">acheshkov@gmail.com</a>&gt;</span><br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Michael. <div><br></div><div>Please show the way to enable foreign key support from sqlite connection.</div><div><br>






</div><div>Now foreign key constrints does not work for sqlite from Yesod.</div><div><br></div><div>Thanks.</div>
<div><br></div><div><br></div><div><a href="http://www.sqlite.org/foreignkeys.html" target="_blank">http://www.sqlite.org/foreignkeys.html</a> </div><div><br>-- <br>Best regards,<br>
Cheshkov Anton <br>Phone: <a href="tel:%2B7%20909%20005%2018%2082" value="+79090051882" target="_blank">+7 909 005 18 82</a><br>Skype: cheshkov_anton<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Cheshkov Anton <br>Phone: <a href="tel:%2B7%20909%20005%2018%2082" value="+79090051882" target="_blank">+7 909 005 18 82</a><br>Skype: cheshkov_anton<br>





</div></div></div>
<br></div></div>_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Cheshkov Anton <br>Phone: +7 909 005 18 82<br>Skype: cheshkov_anton<br>
</div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Cheshkov Anton <br>Phone: +7 909 005 18 82<br>Skype: cheshkov_anton<br>
</div></div>