Skip to content

Commit

Permalink
Catch startup exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand committed Jun 20, 2023
1 parent 528e8ef commit 8a4ae77
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/IoTHub.Portal.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@

namespace IoTHub.Portal.Server
{
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

public static class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
try
{
CreateHostBuilder(args)
.Build()
.Run();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());

Host.CreateDefaultBuilder(args)
.Build().Run();
}
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Expand Down

0 comments on commit 8a4ae77

Please sign in to comment.