[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: |
|
||||||||
| 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 ] |
|
|
| 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. |