Skip to content

Commit

Permalink
* passing exceptions from service construction to exception callback
Browse files Browse the repository at this point in the history
  • Loading branch information
mvacha authored and Seabiscuit committed Apr 22, 2018
1 parent cf7c6c7 commit 709d9da
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ public Host CreateHost()
foreach (HostBuilderConfigurator configurator in _configurators)
builder = configurator.Configure(builder);

return builder.Build(serviceBuilder);
try
{
return builder.Build(serviceBuilder);
}
//Intercept exceptions from serviceBuilder, TopShelf handling is in HostFactory
catch (Exception ex)
{
builder.Settings?.ExceptionCallback(ex);
throw;
}
}

void ApplyCommandLineOptions(IEnumerable<Option> options)
Expand Down

0 comments on commit 709d9da

Please sign in to comment.