On Thursday 01 June 2006 05:46, Jorge Vargas wrote:
> On 5/31/06, Dan Pascu <[EMAIL PROTECTED]> wrote:
> As an example of why most of the time you will send out the "generic"
> this are mysqld error classes.
>
> class MySQLError(StandardError):
> class Warning(Warning, MySQLError):
> class Error(MySQLError):
> class InterfaceError(Error):
> class DatabaseError(Error):
>
> class DataError(DatabaseError):
> class OperationalError(DatabaseError):
> class IntegrityError(DatabaseError):
> class InternalError(DatabaseError):
> class ProgrammingError(DatabaseError):
> class NotSupportedError(DatabaseError):
>
> as you can see half those will fail into the "generic"

I'm of the same opinion. Given the db abstraction that sqlobject offers 
I'm not sure I want to handle a too detailed exception hierarchy if any 
at all. Most of the time if I know it's a DatabaseError it will be enough 
to make a decision. This is why I said that catching all backend's 
specific errors and raising a DatabaseError will do the job as a starter, 
then specific exceptions can be added later as need arises (if such a 
need arises that is).

> > That is true, but in the end do you prefer a solution that covers 60%
> > of the usage cases out there right now or do you prefer to wait until
> > someone will implement the perfect 100% complete solution somewhere
> > in the unknown future?
>
> even thought handling specific db exceptions goes agains the db
> abstraction layer of SQLObject 

I think the same here. A generic exception should do. The any other 
exception I can think of the moment as being useful would be an 
IntegrityError that says that the record you are trying to insert is a 
duplicate one (the uniqueness of some column is not satisfied).

> I think it's better to have 100% then 
> 60% lots of errors could be swallow by the generic exception.

I think the meaning of 60% was not 60% functionality, but 60% coverage of 
user needs.


-- 
Dan


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to