Project

General

Profile

« Previous | Next » 

Revision 434

bin/map: Track Exceptions with ExTracker

View differences:

map
22 22
    else: return None
23 23

  
24 24
def main():
25
    ex_tracker = exc.ExTracker()
26
    
25 27
    env_names = []
26 28
    def usage_err():
27 29
        raise SystemExit('Usage: '+opts.env_usage(env_names, True)+' [commit=1]'
......
163 165
            row_ct_ref = [0]
164 166
            def process_row():
165 167
                try: xml_func.process(root)
166
                except xml_func.SyntaxException, e: exc.print_ex(e, False)
168
                except xml_func.SyntaxException, e: ex_tracker.track(e, False)
167 169
                else:
168 170
                    assert xml_dom.has_one_child(root)
169 171
                    child = root.firstChild
......
171 173
                        sql.with_savepoint(out_db, lambda: db_xml.put(out_db,
172 174
                            child, False, row_ct_ref, out_pkeys))
173 175
                        if commit: out_db.commit()
174
                    except sql.DatabaseErrors, e: exc.print_ex(e)
176
                    except sql.DatabaseErrors, e: ex_tracker.track(e)
175 177
                root.clear()
176 178
            process_input(root, process_row)
177 179
            print 'Inserted '+str(row_ct_ref[0])+' rows'

Also available in: Unified diff