Skip to content

Commit

Permalink
Error handling improved
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFillol committed Apr 24, 2022
1 parent 2c131f2 commit 8402725
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CSV/analyzeCSV.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ func createCSVs(raw []string, nameResultFolder string) error {
var analyzeCNJCSV []CNJ.AnalysisCNJ

for _, cnj := range raw {
dataReturn, _ := CNJ.AnalyzeCNJ(cnj)
dataReturn, err := CNJ.AnalyzeCNJ(cnj)
if err != nil {
analyzeCNJCSV = append(analyzeCNJCSV, CNJ.AnalysisCNJ{
ReceivedCNJ: err.Error(),
ValidCNJ: false,
SegmentName: err.Error(),
SegmentShort: err.Error(),
SourceUnitType: err.Error(),
SourceUnitNumber: err.Error(),
CourtType: err.Error(),
CourtNumber: err.Error(),
Detailed: CNJ.DecomposedCNJ{},
})
}
analyzeCNJCSV = append(analyzeCNJCSV, dataReturn)
}

Expand Down

0 comments on commit 8402725

Please sign in to comment.