A class in Root.Township, Alta.Console.
What a console command returns: a result string or an exception, plus the command that ran. The generic CommandResult<T> subclass carries a typed result.
Constructors
Fields
| Member | What it is |
|---|
protected static Logger logger | Shared NLog logger the results are written to. |
Properties
| Member | What it is |
|---|
Command Command { get; private set; } | The console command that produced this result. |
Exception Exception { get; set; } | The exception the command threw, or null if it succeeded. |
virtual string ResultString { get; } | The result as text. VoidResult uses "Success"; the generic version uses its result's ToString. |
Methods
| Member | What it is |
|---|
static CommandResult ErrorResult(Exception exception, Command command) | Makes a result that wraps an exception thrown by the command. |
virtual void Log() | Writes the result to the console log at trace level. The generic version can print tables or JSON. |
static CommandResult VoidResult(Command command) | Makes a plain "Success" result for commands that return nothing. |
Used in
Members of other types that take, return or hold a CommandResult: