Skip to content

Commit 40d1995

Browse files
authored
Log exception when app fails to start in CLI (#3853)
Log exception when app cannot start in the context of CLI execution.
1 parent c0efe07 commit 40d1995

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ void OnEntryPointExit(Exception exception)
8888

8989
return services;
9090
}
91-
catch (InvalidOperationException)
91+
catch (InvalidOperationException ex)
9292
{
93-
// We're unable to resolve the host, swallow the exception and return null
93+
// We're unable to resolve the host, log the exception and return null
94+
Console.Error.WriteLine(ex.ToString());
9495
}
9596

9697
return null;

0 commit comments

Comments
 (0)