Design question regarding exceptions.

asincero asincero at gmail.com
Tue Jul 17 15:52:19 EDT 2007


I have a class called Users that provides a higher level of
abstraction to an underlying "users" table in a pgsql database.  It
has methods like "addUser()" and "deleteUser()" which, obviously, wrap
the corresponding SQL statements.  My question is would it better to
let any exceptions thrown by the underlying DB-API calls bubble up
from these methods, or should I catch them inside the methods, wrap
them inside my own custom exceptions, and throw those exceptions
instead?

Thanks.

-- Arcadio




More information about the Python-list mailing list