mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
Removes printing of error messages when propagating
This commit is contained in:
parent
3463dde543
commit
8d67c0a6b4
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user