Project

General

Profile

« Previous | Next » 

Revision 452

bin/map: Add input row to exceptions

View differences:

bin/map
95 95
                    if value == None: value = get_value(in_, row)
96 96
                    if value != None:
97 97
                        xpath.put_obj(root, out, row_id, has_types, value)
98
                process_row()
98
                process_row(row)
99 99
        
100 100
        if map_path == None:
101 101
            iter_ = xml_dom.NodeElemIter(doc0.documentElement)
102 102
            util.skip(iter_, xml_dom.is_text) # skip metadata
103 103
            for child in iter_:
104 104
                root.appendChild(child)
105
                process_row()
105
                process_row(child)
106 106
        elif in_is_db:
107 107
            assert in_is_xpaths
108 108
            
......
164 164
            if test: sql.empty_db(out_db)
165 165
            row_ct_ref = [0]
166 166
            
167
            def on_error(e):
168
                exc.add_msg(e, 'row:\n'+str(root))
169
                ex_tracker.track(e)
170
            
171
            def process_row():
167
            def process_row(input_row):
168
                def on_error(e):
169
                    exc.add_msg(e, 'output row:\n'+str(root))
170
                    exc.add_msg(e, 'input row:\n'+str(input_row))
171
                    ex_tracker.track(e)
172
                
172 173
                xml_func.process(root, on_error)
173 174
                if not xml_dom.is_empty(root):
174 175
                    assert xml_dom.has_one_child(root)
......
185 186
            out_db.rollback()
186 187
            out_db.close()
187 188
    else: # output is XML
188
        def process_row(): pass
189
        def process_row(input_row): pass
189 190
        process_input(root, process_row)
190 191
        xml_func.process(root)
191 192
        doc.writexml(sys.stdout, **xml_dom.prettyxml_config)

Also available in: Unified diff