On 5/31/06, Oleg Broytmann <email@example.com> wrote:
On Wed, May 31, 2006 at 10:38:13PM +0300, Dan Pascu wrote:
> On Wednesday 31 May 2006 21:28, Oleg Broytmann wrote:
> to raise a single generic exception (say DatabaseError) with
> specific details about the error, or the desire is to have a hierarchy of
> exceptions like the backends have (DatabaseError, IntegrityError,
> OperationalError, ...)?
I have been thinking about the second option. Catch DB API driver's
exceptions and translate them to SQLObject's exceptions.
> Because a single generic exception will be pretty easy to add (just a
> guess without looking at the code), while having a hierarchy will be more
> complex as mappings between backend errors and sqlobject errors need to
> be made and a common denominator needs to be found between backend
The biggest problem is to translate exceptions. One DB API driver raises
OperationError when another raises IntegrityError. We need to collect
information about what exceptions every driver raise in what situations.