Browse Source

Fix exception thrown when tye run is shutting down and event pipe tries to restart.

davidfowl/dependencies
Justin Kotalik 7 years ago
parent
commit
7bb8ce55ff
  1. 9
      src/micronetes/Micronetes.Hosting.Diagnostics/DiagnosticsCollector.cs

9
src/micronetes/Micronetes.Hosting.Diagnostics/DiagnosticsCollector.cs

@ -197,6 +197,11 @@ namespace Micronetes.Hosting.Diagnostics
{ {
break; break;
} }
// If the process has already exited, a ServerNotAvailableException will be thrown.
catch (ServerNotAvailableException)
{
break;
}
catch (Exception ex) catch (Exception ex)
{ {
if (!cancellationToken.IsCancellationRequested) if (!cancellationToken.IsCancellationRequested)
@ -230,6 +235,10 @@ namespace Micronetes.Hosting.Diagnostics
catch (PlatformNotSupportedException) catch (PlatformNotSupportedException)
{ {
} }
// If the process has already exited, a ServerNotAvailableException will be thrown.
catch (ServerNotAvailableException)
{
}
} }
using var _ = cancellationToken.Register(() => StopSession()); using var _ = cancellationToken.Register(() => StopSession());

Loading…
Cancel
Save