mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-06 04:28:15 +08:00
Exposes Pretty property of CommandAppException
If a user is propagating the exceptions we aren't going to automatically display them. They might still want to get this exception message and use it, so we'll make it publicly available.
This commit is contained in:

committed by
Patrik Svensson

parent
8d67c0a6b4
commit
01f707c78d
@ -53,6 +53,15 @@ namespace Spectre.Console.Testing
|
||||
}
|
||||
catch (T ex)
|
||||
{
|
||||
if (ex is CommandAppException commandAppException && commandAppException.Pretty != null)
|
||||
{
|
||||
console.Write(commandAppException.Pretty);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
return new CommandAppFailure(ex, console.Output);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Reference in New Issue
Block a user