Skip to content

Commit 3560027

Browse files
committed
Only trace the event if tracing is enabled (should've read the comments)
1 parent bbc9193 commit 3560027

File tree

1 file changed

+1
-1
lines changed
  • src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Utilities

1 file changed

+1
-1
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Utilities/AsyncHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ private static void ObserveContinuationException(Task continuationTask)
766766
continuationTask.ContinueWith(
767767
static task =>
768768
{
769-
SqlClientEventSource.Log.TraceEvent($"Unobserved task exception: {task.Exception}");
769+
SqlClientEventSource.Log.TryTraceEvent($"Unobserved task exception: {task.Exception}");
770770
return _ = task.Exception;
771771
},
772772
TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously);

0 commit comments

Comments
 (0)