Skip to content

Feature Request - Type Conversion Errors #71

Open

Description

@OpenSpacesAndPlaces

Using FixedLengthFileEngineFactory.

When there is a type conversion problem like "is not a valid value for Int32".
It doesn't get handled by "handleEntryReadError:" and instead throws a global exception.


at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.ComponentModel.TypeConverter.ConvertFromString(String text)
at FlatFile.Core.Extensions.TypeChangeExtensions.Convert(String input, Type targetType) in TypeChangeExtensions.cs:line 13
at FlatFile.Core.Base.LineParserBase`2.GetFieldValueFromString(TFieldSettings fieldSettings, String memberValue) in LineParserBase.cs:line 44
at FlatFile.FixedLength.Implementation.FixedLengthLineParser.ParseLine[TEntity](String line, TEntity entity) in FixedLengthLineParser.cs:line 23
at FlatFile.Core.Base.FlatFileEngine`2.TryParseLine[TEntity](String line, Int32 lineNumber, TEntity& entity) in FlatFileEngine.cs:line 122
at FlatFile.Core.Base.FlatFileEngine`2.d__8`1.MoveNext() in FlatFileEngine.cs:line 93

Activity

  1. OpenSpacesAndPlaces commented on Mar 25, 2018

    @OpenSpacesAndPlaces
    Author

    Additional detail: |
    Throwing a catch into the source - the specific issue in my case was an empty string was making it to "GetFieldValueFromString" and was trying to be converted to Int32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions