From cf17e19a253cfb06cbe2deb5f347781bb76efb15 Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Mon, 18 Sep 2023 19:48:45 -0400 Subject: [PATCH] Include status reason in build message --- src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs | 1 + .../Services/ClearMLNmtEngineBuildJob.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs b/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs index 256c0ea36..c6fefad9d 100644 --- a/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs +++ b/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs @@ -21,6 +21,7 @@ public class ClearMLTask public ClearMLProject Project { get; set; } = default!; public ClearMLTaskStatus Status { get; set; } public string StatusReason { get; set; } = default!; + public string StatusMessage { get; set; } = default!; public int LastIteration { get; set; } public int ActiveDuration { get; set; } } diff --git a/src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs b/src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs index c171c0fde..38905c86f 100644 --- a/src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs +++ b/src/SIL.Machine.AspNetCore/Services/ClearMLNmtEngineBuildJob.cs @@ -125,7 +125,9 @@ await _engines.UpdateAsync( ); throw new OperationCanceledException(); case ClearMLTaskStatus.Failed: - throw new InvalidOperationException(clearMLTask.StatusReason); + throw new InvalidOperationException( + $"{clearMLTask.StatusReason} : {clearMLTask.StatusMessage}" + ); } if (clearMLTask.Status is ClearMLTaskStatus.Completed) break;