public static IAppMessage CommandCompletionError(ICommandResult result, IAppMessage CompletionMessage) => error("Successfully executed the @CommandName command but was unable to complete it: @CompletionError", new { result.Spec.CommandName, CompletionError = CompletionMessage.Format() });
public static IAppMessage CommandExecutionAndCompletionError(ICommandResult result, IAppMessage CompletionMessage) => error("An error occurred while executing the @CommandName command and also unabled to complete it: Execution Error - @ExecutionError; Completion Error = @CompletionError", new { result.Spec.CommandName, ExecutionError = result.Message.Format(), CompletionError = CompletionMessage.Format() });
/// <summary> /// Renders a message for display /// </summary> /// <param name="Message"></param> /// <param name="Orignator"></param> /// <returns></returns> public static string Format(this IAppMessage Message, SystemNodeIdentifier Orignator) { var tsFmt = Message.Timestamp.FormatTimestamp(); return(concat(tsFmt, " ", Orignator, "> ", Message.Format(false))); }
internal static string Format(IAppMessage message, string prepend, string postpend, bool ts) => (!string.IsNullOrWhiteSpace(prepend) ? $"{prepend} {message.Format(false)}" : message.Format(ts)) + (!string.IsNullOrWhiteSpace(postpend) ? $" {postpend}" : String.Empty);
public static T fail <T>(IAppMessage reason, [CallerMemberName] string member = null, [CallerFilePath] string path = null, [CallerLineNumber] int line = 0) => throw new Exception <int>(reason.Format(false), member, path, line);
public override string ToString() => Message.Format();