diff --git a/ECMJobRunner.Application/Common/Exceptions/JobException.cs b/ECMJobRunner.Application/Common/Exceptions/JobException.cs index 0c89a86..74b0db3 100644 --- a/ECMJobRunner.Application/Common/Exceptions/JobException.cs +++ b/ECMJobRunner.Application/Common/Exceptions/JobException.cs @@ -26,7 +26,7 @@ namespace ECMJobRunner.Application.Common.Exceptions /// public JobException(string jobName, string processName, string batchId, string? reason, Exception? innerException, params (string Name, string? Value, bool IgnoreIfNull)[] details) : base( - Message(jobName, + CreateMessage(jobName, [ ("Process Name", processName, false), ("Batch Id", batchId, false), @@ -65,26 +65,22 @@ namespace ECMJobRunner.Application.Common.Exceptions /// Message format: /// /// {jobName} could not be completed. - /// ───────────────────────────────────────── /// Process Name: {processName} /// Batch Id: {batchId} /// {additional details...} - /// ───────────────────────────────────────── /// /// Details with IgnoreIfNull=true are omitted when their value is null. /// - internal static string Message(string jobName, IEnumerable<(string Name, string? Value, bool IgnoreIfNull)> details) + internal static string CreateMessage(string jobName, IEnumerable<(string Name, string? Value, bool IgnoreIfNull)> details) { var message = new System.Text.StringBuilder(); message.AppendLine($"{jobName} could not be completed."); - message.AppendLine("─────────────────────────────────────────"); foreach (var (name, value, ignoreNullValue) in details) { if (ignoreNullValue && value is null) continue; message.AppendLine($" {name}: {value}"); } - message.AppendLine("─────────────────────────────────────────"); return message.ToString(); } }