Fix parser issue when HHMMSS is too long

This commit is contained in:
2017-11-16 09:36:35 -05:00
parent e6bf6745b2
commit 19d09c8883
8 changed files with 88 additions and 1 deletions
@@ -1,4 +1,5 @@
using System;
using System.Data.Entity.Validation;
using System.Linq;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Parsers;
@@ -53,11 +54,22 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
{
var parser = new LeafInputCsvParser(outputFile.FileContents.Contents);
var data = parser.Parse();
LeafInputCleaner.Clean(data);
data.LeafInput = leafInput;
data.LeafOutputFile = outputFile;
leafInput.LeafInputData.Add(data);
DataService.UpdateLeafInput(leafInput);
}
catch (DbEntityValidationException ex)
{
var valErrors =
string.Join("",
ex.EntityValidationErrors.Select(
e => string.Join(Environment.NewLine,
e.ValidationErrors.Select(v => $"{v.PropertyName} - {v.ErrorMessage}"))));
Logger.Error($"LeafInput: {leafInput.Id}, while parsing CleanedInput file: {outputFile.Filename}"+
$"{Environment.NewLine}Validation Errors:{valErrors}");
}
catch (Exception e)
{
Logger.Error($"LeafInput: {leafInput.Id}, while parsing CleanedInput file: {outputFile.Filename}", e);