[CSHARP-1097] Add ConnectionId to MongoException (or some suitable subclass of it) Created: 06/Nov/14  Updated: 02/Apr/15  Resolved: 24/Nov/14

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

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CSHARP-1106 Review driver exception hierarchy Closed

 Description   

When diagnosing why an exception was thrown it is often necessary to refer to the server logs. In order to do so, the following information is needed:

1. In a multiple server deployment, we need to know which server's logs to look at

2. We need to know the server's connection Id to find the corresponding entry in the server's log

Adding a ConnectionId to MongoException would provide that information.



 Comments   
Comment by Githook User [ 24/Nov/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1097: Add ConnectionId to MongoConnectionException and MongoServerException.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/f1e8659efe2715e6f7c619f144761f9f4f68d437

Comment by Robert Stam [ 17/Nov/14 ]

Before we can add a ConnectionId to some exception class we need a suitable exception class to add it to. See CSHARP-1106.

Comment by Robert Stam [ 17/Nov/14 ]

MongoConnection is actually too high in the exception hiearchy to be adding a ConnectionId, because not all of its subclasses are related to communication with the server, so a ConnectionId does not always apply.

Work on this ticket will have to wait until the exception hierarchy is modified to introduce an appropriate intermediate level class to be the base class of all exceptions related to communication with the server. It is that new intermediate class that should have a ConnectionId.

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