# HG changeset patch # User Pierre-Yves David # Date 1372078526 -7200 # Node ID 6fb3f010630163b0626607fd15649c70dd2953b0 # Parent 5378a738f33306f893f1148ccdbfed2dc11306e1 [dbapi] move ProgrammingError into cubicweb module A new ``repoapi`` will be introduced as a replacement for the dbapi. It will need ProgrammingError too. Related to #2503918 diff -r 5378a738f333 -r 6fb3f0106301 __init__.py --- a/__init__.py Mon Jun 17 15:00:41 2013 +0200 +++ b/__init__.py Mon Jun 24 14:55:26 2013 +0200 @@ -221,3 +221,15 @@ errors[rname(*key)] = errors.pop(key) return ValidationError(getattr(entity, 'eid', entity), errors, substitutions, i18nvalues) + + +# exceptions ################################################################## + +class ProgrammingError(Exception): #DatabaseError): + """Exception raised for errors that are related to the database's operation + and not necessarily under the control of the programmer, e.g. an unexpected + disconnect occurs, the data source name is not found, a transaction could + not be processed, a memory allocation error occurred during processing, + etc. + """ + diff -r 5378a738f333 -r 6fb3f0106301 dbapi.py --- a/dbapi.py Mon Jun 17 15:00:41 2013 +0200 +++ b/dbapi.py Mon Jun 24 14:55:26 2013 +0200 @@ -37,8 +37,8 @@ from logilab.common.decorators import monkeypatch, cachedproperty from logilab.common.deprecation import deprecated -from cubicweb import ETYPE_NAME_MAP, AuthenticationError,\ - cwvreg, cwconfig +from cubicweb import (ETYPE_NAME_MAP, AuthenticationError, ProgrammingError, + cwvreg, cwconfig) from cubicweb.repoapi import get_repository from cubicweb.req import RequestSessionBase @@ -391,16 +391,6 @@ set_log_methods(DBAPIRequest, getLogger('cubicweb.dbapi')) -# exceptions ################################################################## - -class ProgrammingError(Exception): #DatabaseError): - """Exception raised for errors that are related to the database's operation - and not necessarily under the control of the programmer, e.g. an unexpected - disconnect occurs, the data source name is not found, a transaction could - not be processed, a memory allocation error occurred during processing, - etc. - """ - # cursor / connection objects ##################################################