Project

General

Profile

« Previous | Next » 

Revision 3657

db_xml.py: put(): Inserting node: Wrap sql_io.put_table() call in catch-all exception handler that calls on_error_() (wrapper for error handler provided by caller) and returns None. This both adds additional debugging info to the exception (in on_error_()) and allows recovery from arbitrary exceptions that happen in sql_io.put_table(), so that an exception does not abort the import.

View differences:

db_xml.py
127 127
            row[out_col] = sql_gen.NamedCol(out_col, value)
128 128
    
129 129
    # Insert node
130
    pkeys_loc = sql_io.put_table(db, out_table, in_tables, row, row_ins_ct_ref,
131
        next, col_defaults, on_error_)
130
    try: pkeys_loc = sql_io.put_table(db, out_table, in_tables, row,
131
        row_ins_ct_ref, next, col_defaults, on_error_)
132
    except Exception, e:
133
        on_error_(e)
134
        return None
132 135
    
133 136
    sql.empty_temp(db, set(in_tables) - no_empty)
134 137
    

Also available in: Unified diff