
I can not catch exception
*user error (SQLite3 returned ErrorConstraint while attempting to perform
step.*)
*
*
I do it as:
*res <- runDB $ E.catch (insertBy offer) (\(e :: E.SomeException) -> return
$ Left undefined)
*
2011/4/26 Anton Cheshkov
Ok.
I recompiled persistent with new changes. All works how i want and expect. But now *insertBy* function are not so safe as earlier.
*The insertBy function* checks only unique constrains defined on yesod framework level via Unique... constructions . Now *insertBy* function throws exception if we try to insert 'bad' value to column with foreign constraint.
Please show me how to catch exception. I think it would something like: * * *import qualified Control.Exception.Control as E* *...* *do* * res <- runDB $ E.catch (insertBy offer) (\_ -> return Left ())*
But my exception handler is wrong.
Thanks.
2011/4/26 Greg Weber
Thanks!
Please send a pull request to Michael.
On Tue, Apr 26, 2011 at 5:58 AM, Anton Cheshkov
wrote: I have pushed branch to fix it. probably it should be helpful. https://github.com/acheshkov/persistent
https://github.com/acheshkov/persistentThanks.
2011/4/26 Anton Cheshkov
Hi Michael.
Please show the way to enable foreign key support from sqlite connection.
Now foreign key constrints does not work for sqlite from Yesod.
Thanks.
http://www.sqlite.org/foreignkeys.html
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton