Removes printing of error messages when propagating

This commit is contained in:
Phil Scott 2021-04-23 08:12:41 -04:00 committed by Patrik Svensson
parent 3463dde543
commit 8d67c0a6b4

View File

@ -90,13 +90,6 @@ namespace Spectre.Console.Cli
}
catch (Exception ex)
{
// Render the exception.
var pretty = GetRenderableErrorMessage(ex);
if (pretty != null)
{
_configurator.Settings.Console.SafeRender(pretty);
}
// Should we always propagate when debugging?
if (Debugger.IsAttached
&& ex is CommandAppException appException
@ -110,6 +103,13 @@ namespace Spectre.Console.Cli
throw;
}
// Render the exception.
var pretty = GetRenderableErrorMessage(ex);
if (pretty != null)
{
_configurator.Settings.Console.SafeRender(pretty);
}
return -1;
}
}