On Sun, Jun 19, 2011 at 1:02 PM, Dan Halbert <halbert(at)halwitz(dot)org> wrote:
> Is it that you don't just want to raise your own exceptions manually, e.g.:
> except dbconn.InternalError, ex:
> if ... :
> raise OutOfStockException(...)
Yeah, this is what I'm doing now. But there's a good chance that
something is going to get mapped to the OutOfStockException when it is
really a completely different kind of exception, like maybe I forgot
to set a non-null column.
So, really, I want to be able raise specific exceptions within
postgresql, and then define how those are converted to python objects.
Maybe I need to verify that postgresql supports custom exceptions.
W. Matthew Wilson
In response to
psycopg by date
|Next:||From: Daniele Varrazzo||Date: 2011-06-20 14:03:42|
|Subject: Re: Can I map "raise XXX" to some custom python exceptions?|
|Previous:||From: W. Matthew Wilson||Date: 2011-06-19 15:21:09|
|Subject: Can I map "raise XXX" to some custom python exceptions?|