digital-preservation / csv-validator

CSV Validation Tool and API (CSV Schema RI)
http://digital-preservation.github.io/csv-validator
Mozilla Public License 2.0
205 stars 55 forks source link

Misleading error message when the column name in schema rule does not exist in the CSV file. #500

Open sparkhi opened 6 months ago

sparkhi commented 6 months ago

Consider a CSVS file with a rule department: is("XYZ") and in($filepath)

and a CSV file with data as:

batch_code,department,held_by,file_path
XYZ32Y24S000,XYZ,"The National Archives, Kew",file:///XYZ_32/content/1/2/3/4/

The error you get is Error: java.util.NoSuchElementException: None.get

Ideally, the error should indicate something on the lines of "The column 'filepath' cannot be found in the CSV file" which will help the user immediately figure out what went wrong