diff --git a/src/Refitter/GenerateCommand.cs b/src/Refitter/GenerateCommand.cs index 1c5a922d..ecaf693c 100644 --- a/src/Refitter/GenerateCommand.cs +++ b/src/Refitter/GenerateCommand.cs @@ -83,9 +83,8 @@ public override async Task ExecuteAsync(CommandContext context, Settings se if (exception is not OpenApiValidationException) { - AnsiConsole.MarkupLine($"[red]Error: {exception.Message}[/]"); - AnsiConsole.MarkupLine($"[red]Exception: {exception.GetType()}[/]"); - AnsiConsole.MarkupLine($"[yellow]Stack Trace:{Crlf}{exception.StackTrace}[/]"); + AnsiConsole.MarkupLine("[red]Exception:[/]"); + AnsiConsole.WriteException(exception); AnsiConsole.WriteLine(); }