Skip to content

Commit 2921a2f

Browse files
Joe Martypcreux
authored andcommitted
Make valid_header? handle MalformedCSVErrors (#85)
1 parent 3c9d9b2 commit 2921a2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/csv_importer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def valid_header?
8585
end
8686

8787
header.valid?
88+
rescue CSV::MalformedCSVError => e
89+
@report = Report.new(status: :invalid_csv_file, parser_error: e.message)
90+
false
8891
end
8992

9093
# Run the import. Return a Report.

0 commit comments

Comments
 (0)