Revision 2451
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
910 | 910 |
|
911 | 911 |
def log_exc(e): |
912 | 912 |
log_debug('Caught exception: '+exc.str_(e, first_line_only=True)) |
913 |
def remove_all_rows(msg): |
|
914 |
warnings.warn(DbWarning(msg)) |
|
915 |
log_debug(msg.partition('\n')[0]) |
|
913 |
def remove_all_rows(): |
|
916 | 914 |
log_debug('Returning NULL for all rows') |
917 | 915 |
limit_ref[0] = 0 # just create an empty pkeys table |
918 | 916 |
def ignore(in_col, value): |
... | ... | |
965 | 963 |
out_col, = e.cols |
966 | 964 |
try: in_col = mapping[out_col] |
967 | 965 |
except KeyError: |
968 |
remove_all_rows('Missing mapping for NOT NULL '+out_col) |
|
966 |
log_debug('Missing mapping for NOT NULL '+out_col) |
|
967 |
remove_all_rows() |
|
969 | 968 |
else: remove_rows(in_col, None) |
970 | 969 |
except FunctionValueException, e: |
971 | 970 |
log_exc(e) |
... | ... | |
976 | 975 |
except DatabaseErrors, e: |
977 | 976 |
log_exc(e) |
978 | 977 |
|
979 |
remove_all_rows('No handler for exception: '+exc.str_(e)) |
|
978 |
msg = 'No handler for exception: '+exc.str_(e, first_line_only=True) |
|
979 |
warnings.warn(DbWarning(msg)) |
|
980 |
log_debug(msg) |
|
981 |
remove_all_rows() |
|
980 | 982 |
# after exception handled, rerun loop with additional constraints |
981 | 983 |
|
982 | 984 |
if row_ct_ref != None and cur.rowcount >= 0: |
Also available in: Unified diff
sql.py: put_table(): Only display warning for exceptions with no handler (which are unexpected), not missing mappings for NOT NULL columns (which are normal in datasources without those columns)