From b317f0c65a6a4d1ba0691eb988e0595b2c25bdf2 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Sat, 9 Apr 2016 22:20:55 -0400 Subject: [PATCH] Add error message info for entities --- Core/Entities/LeafInput.cs | 3 +++ Core/Entities/LeafOutputFile.cs | 2 ++ Core/Remote/PiscalSshClient.cs | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Entities/LeafInput.cs b/Core/Entities/LeafInput.cs index 2a5eb98..1c35af4 100644 --- a/Core/Entities/LeafInput.cs +++ b/Core/Entities/LeafInput.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; namespace LeafWeb.Core.Entities { @@ -10,6 +11,8 @@ namespace LeafWeb.Core.Entities public virtual ICollection InputFiles { get; set; } public virtual ICollection OutputFiles { get; set; } + public LeafOutputFile OutputErrorMessage => OutputFiles?.FirstOrDefault(f => f.IsErrorMessage); + public LeafOutputFile OutputWarningMessage => OutputFiles?.FirstOrDefault(f => f.IsWarningMessage); public LeafInputStatusType CurrentStatus { get; set; } public virtual ICollection StatusHistory { get; set; } diff --git a/Core/Entities/LeafOutputFile.cs b/Core/Entities/LeafOutputFile.cs index a557a67..cd14c80 100644 --- a/Core/Entities/LeafOutputFile.cs +++ b/Core/Entities/LeafOutputFile.cs @@ -13,5 +13,7 @@ namespace LeafWeb.Core.Entities // convention for the filename which LeafCharter uses public bool IsLeafChartFile => Filename?.StartsWith("cntrlcomparison") ?? false; + public bool IsErrorMessage => Filename?.Contains("errormessage") ?? false; + public bool IsWarningMessage => Filename?.Contains("warningmessage") ?? false; } } diff --git a/Core/Remote/PiscalSshClient.cs b/Core/Remote/PiscalSshClient.cs index a9c5412..c9cd001 100644 --- a/Core/Remote/PiscalSshClient.cs +++ b/Core/Remote/PiscalSshClient.cs @@ -76,7 +76,7 @@ namespace LeafWeb.Core.Remote if (command.ExitStatus != 0) throw new PiscalClientException(command.Result); - _logger.Debug(command.Result); + _logger.Debug("RunLeafInput result: " + command.Result); } }