[CSHARP-1523] Throw a more specific version of TimeoutException Created: 06/Jan/16  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Error Handling
Affects Version/s: 2.1.1
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Aristarkh Zagorodnikov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

Hello!
I ask you to consider throwing a specific subclass of TimeoutException (i.e. MongoTimeoutException) instead of the TimeoutException itself to aid debugging and external failover. Throwing TimeoutException makes it harder to differentiate mongo-specific (pool timeouts, etc.) timeouts from timeouts in user code. Throwing a subclass should not break backwards compatibility since existing catch handlers, "as" tests and proper type testing (Type.IsAssignableFrom) will continue to work properly. The sites to consider are connection stream factory, cluster manager and connection pooling code.
Thank you.



 Comments   
Comment by Aristarkh Zagorodnikov [ 06/Jan/16 ]

An even better name would be MongoConnectionTimeoutException to differentiate it from MongoExecutionTimeoutException.

Comment by Aristarkh Zagorodnikov [ 06/Jan/16 ]

Sorry, I mistakenly filed this issue as "Major", I consider it of minor importance.

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