digital-preservation / csv-validator

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

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

Open sparkhi opened 4 months ago

sparkhi commented 4 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