You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CsvReader.TryGetField<T>() method is used for deserializing fields. If the field can not be deserialized (i.e., the value is empty, for example for numeric value), the method returns false. This can propagate in a CsvConverter further to a deserialization failure of the whole record. For example, here: ValidationPointCsvConverter, line 33 (from the UXI.GazeToolkit Validation filter)
The CsvConverter.ReadCsv() should catch it, but it only checks if its own type is nullable, not the type of the field. Even when the ThrowOnFailedRead is set to true, the converter will not throw an exception, it will return default value (i.e., null).
This is in some cases expected, when we want to determine whether the record is really a null value - we distinguish it using non-nullable fields that are empty in the CSV. But ThrowOn* settings do not fully cover all possibilities of throwing exceptions on failed read.
The
CsvReader.TryGetField<T>()
method is used for deserializing fields. If the field can not be deserialized (i.e., the value is empty, for example for numeric value), the method returns false. This can propagate in aCsvConverter
further to a deserialization failure of the whole record. For example, here:ValidationPointCsvConverter, line 33 (from the UXI.GazeToolkit Validation filter)
The
CsvConverter.ReadCsv()
should catch it, but it only checks if its own type is nullable, not the type of the field. Even when theThrowOnFailedRead
is set totrue
, the converter will not throw an exception, it will return default value (i.e.,null
).This is in some cases expected, when we want to determine whether the record is really a null value - we distinguish it using non-nullable fields that are empty in the CSV. But
ThrowOn*
settings do not fully cover all possibilities of throwing exceptions on failed read.Due to this issue, this test fails in UXI.GazeToolkit:
ValidationPointCsvReaderTest.ReadAll_MissingFieldInRecord_ThrowsException()
The text was updated successfully, but these errors were encountered: