Project

General

Profile

« Previous | Next » 

Revision 360

sql.py: Include sql.DbException in DatabaseErrors list

View differences:

sql.py
14 14

  
15 15
def _add_cursor_info(e, cur): exc.add_msg(e, 'query: '+get_cur_query(cur))
16 16

  
17
class NameException(Exception): pass
18

  
19 17
class DbException(exc.ExceptionWithCause):
20 18
    def __init__(self, msg, cause=None, cur=None):
21 19
        exc.ExceptionWithCause.__init__(self, msg, cause)
22 20
        if cur != None: _add_cursor_info(self, cur)
23 21

  
22
class NameException(DbException): pass
23

  
24 24
class ExceptionWithColumn(DbException):
25 25
    def __init__(self, col, cause=None):
26 26
        DbException.__init__(self, 'column: '+col, cause)
......
136 136
    'PostgreSQL': ('psycopg2', {}),
137 137
}
138 138

  
139
DatabaseErrors_set = set()
140
DatabaseErrors = ()
139
DatabaseErrors_set = set([DbException])
140
DatabaseErrors = tuple(DatabaseErrors_set)
141 141

  
142 142
def _add_module(module):
143 143
    DatabaseErrors_set.add(module.DatabaseError)

Also available in: Unified diff