Revision 2145
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
25 | 25 |
|
26 | 26 |
class DbException(exc.ExceptionWithCause): |
27 | 27 |
def __init__(self, msg, cause=None, cur=None): |
28 |
exc.ExceptionWithCause.__init__(self, msg, cause) |
|
28 |
exc.ExceptionWithCause.__init__(self, msg, cause, cause_newline=True)
|
|
29 | 29 |
if cur != None: _add_cursor_info(self, cur) |
30 | 30 |
|
31 | 31 |
class ExceptionWithName(DbException): |
32 | 32 |
def __init__(self, name, cause=None): |
33 |
DbException.__init__(self, 'name: '+str(name), cause) |
|
33 |
DbException.__init__(self, 'for name: '+str(name), cause)
|
|
34 | 34 |
self.name = name |
35 | 35 |
|
36 | 36 |
class ExceptionWithColumns(DbException): |
37 | 37 |
def __init__(self, cols, cause=None): |
38 |
DbException.__init__(self, 'columns: '+(', '.join(cols)), cause) |
|
38 |
DbException.__init__(self, 'for columns: '+(', '.join(cols)), cause)
|
|
39 | 39 |
self.cols = cols |
40 | 40 |
|
41 | 41 |
class NameException(DbException): pass |
Also available in: Unified diff
sql.py: Cleaned up DbException's and subclasses' messages