Skip to content

Commit e658d11

Browse files
committed
iterator fix
1 parent ba6b397 commit e658d11

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

converter/iterator.go

+8-10
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,20 @@ func iterate(typeName string, xmlFile *os.File, csvFile *os.File, skipHTMLDecodi
3636
totalCounter++
3737
encoder, _ := encoders.NewEncoder(typeName)
3838
err = xmlDecoder.DecodeElement(&encoder, &ty)
39-
checkError(err, xmlFile)
39+
if err != nil {
40+
log.Printf("[%s] Error: %s", typeName, err)
41+
continue
42+
}
4043

4144
err = csvWriter.Write(encoder.GETCSVRow(skipHTMLDecoding))
42-
checkError(err, xmlFile)
45+
if err != nil {
46+
log.Printf("[%s] Error: %s", typeName, err)
47+
continue
48+
}
4349
convertedCounter++
4450
}
4551
}
46-
4752
}
4853

4954
return
5055
}
51-
52-
func checkError(err error, file *os.File) {
53-
if err != nil {
54-
log.Printf("[%s] Error: %s",
55-
file.Name(), err)
56-
}
57-
}

0 commit comments

Comments
 (0)