Re: [pylons-devel] Uncatchable InvalidRequestError within view depending on order of SQLAlchemy queries

2016-03-21 Thread Simon King
Your exception block *is* catching an exception, but that's not the exception you are seeing being logged. Imagine the code in pyramid_tm does something like this (where "handler" is the view function, in your case exception_test): # Actual code is at #

Re: [pylons-devel] Uncatchable InvalidRequestError within view depending on order of SQLAlchemy queries

2016-03-21 Thread Simon King
On Sat, Mar 19, 2016 at 3:44 AM, Zsolt Ero wrote: > My project is based on standard SQLAlchemy scaffold, ZTE, using ORM. > Pyramid 1.5.8. > > I'm trying to catch an IntegrityError (unique key constraint), I've made a > very minimal example > >

[pylons-devel] Uncatchable InvalidRequestError within view depending on order of SQLAlchemy queries

2016-03-18 Thread Zsolt Ero
My project is based on standard SQLAlchemy scaffold, ZTE, using ORM. Pyramid 1.5.8. I'm trying to catch an IntegrityError (unique key constraint), I've made a very minimal example @view_config(route_name='exception_test', renderer='json') def exception_test(request): user =