Skip to content

Commit 2d08109

Browse files
Valerii SarkisovIvan Gavryliuk
authored andcommitted
Remove empty catch block. The issue with Flush method was fixed in
the version 2.6.0-Beta4 of ApplicationInsights. See microsoft/ApplicationInsights-dotnet#755
1 parent e61a966 commit 2d08109

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/Serilog.Sinks.ApplicationInsights/Sinks/ApplicationInsights/ApplicationInsightsSinkBase.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,8 @@ protected virtual void Dispose(bool disposeManagedResources)
199199
// attempt to free managed resources
200200
try
201201
{
202-
// this apparently (see https://github.com/serilog/serilog-sinks-applicationinsights/issues/46#issuecomment-379218037) throws a NullReference Exception on app shutdown..
203202
_telemetryClient?.Flush();
204203
}
205-
catch (Exception)
206-
{
207-
// .. and as ugly as THIS is, .Dispose() methods shall not throw exceptions
208-
}
209204
finally
210205
{
211206
_telemetryClient = null;

0 commit comments

Comments
 (0)