private ParseFileResult ParseDataFileWithLocale(Configuration configuration, byte[] csvBytes)
        {
            using (LocaleScope.WithLocale(configuration.LocaleName))
            {
                try
                {
                    return(ParseDataFile(configuration, csvBytes));
                }
                catch (Exception exception)
                {
                    Log.Error($"Configuration '{configuration.Id}' failed to parse file: {exception.Message}");

                    return(ParseFileResult.CannotParse(exception));
                }
            }
        }
Exemplo n.º 2
0
        private ParseFileResult ParseDataFileWithLocale(Configuration configuration, byte[] csvBytes)
        {
            using (LocaleScope.WithLocale(configuration.LocaleName))
            {
                try
                {
                    if (new ExcelParser().TryLoadSingleSheet(configuration, csvBytes, out var sheetBytes))
                    {
                        csvBytes = sheetBytes;
                    }

                    return(ParseDataFile(configuration, csvBytes));
                }
                catch (Exception exception)
                {
                    Log.Error($"Configuration '{configuration.Id}' failed to parse file: {exception.Message}");

                    return(ParseFileResult.CannotParse(exception));
                }
            }
        }