[CSHARP-473] Unexpected InvalidOperationException in MongoServerInstance.AcquireConnection Created: 21/May/12  Updated: 20/Mar/14  Resolved: 24/May/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4.2
Fix Version/s: 2.0

Type: Improvement Priority: Major - P3
Reporter: Aristarkh Zagorodnikov Assignee: Craig Wilson
Resolution: Duplicate Votes: 0
Labels: connection, exception
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-474 Review all exceptions thrown by the C... Closed
Backwards Compatibility: Minor Change

 Description   

Currently, when server goes offline and background monitoring marks server as disconnected, the attempt to acquire connection from this server leads to an InvalidOperationException("Server instance

{0}

is no longer connected."). While technically this is correct (InvalidOperationException is perfectly fine when object's internal state is unexpected), MongoConnectionException would be much better in terms of uniformness (connection failed in one way or another, hence the MongoConnectionException).



 Comments   
Comment by Craig Wilson [ 08/Sep/12 ]

CSHARP-474 will handle this.

Comment by Craig Wilson [ 24/May/12 ]

We'll be reviewing all the exceptions that get thrown for 1.5. However, because these could be breaking changes, We will probably wait until 2.0 to make these changes.

Generated at Wed Feb 07 21:36:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.