We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03fd9b5 commit f535711Copy full SHA for f535711
MongoDB.Driver/Operations/QueryOperation.cs
@@ -115,20 +115,18 @@ public IEnumerator<TDocument> Execute(IConnectionProvider connectionProvider)
115
}
116
117
118
- catch
119
- {
120
- if (reply != null && reply.CursorId != 0)
121
122
- try { KillCursor(connectionProvider, reply.CursorId); }
123
- catch { } // ignore exceptions and rethrow the original exception
124
- }
125
- throw;
126
127
finally
128
{
129
if (reply != null && reply.CursorId != 0)
130
131
- KillCursor(connectionProvider, reply.CursorId);
+ try
+ {
+ KillCursor(connectionProvider, reply.CursorId);
+ }
+ catch
+ // don't throw any exceptions from the finally block
132
133
134
0 commit comments