[JAVA-884] Create a finer-grained exception hierarchy and use it consistently Created: 18/Jul/13  Updated: 31/Jan/18  Resolved: 31/Jan/18

Status: Closed
Project: Java Driver
Component/s: API, Error Handling
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

It's currently rather difficult to handle exceptions thrown by the driver. The driver throws MongoException subclasses like Network in some cases, but not in all cases that it seems like it should. And it throws the generic MongoException in many cases, making it difficult to distinguish. This is particularly important when clients are trying to use the exception type to determine a course of action, like whether to attempt a retry.

The goal of this ticket is to create a more fine-grained exception hierarchy and to use it consistently.



 Comments   
Comment by Jeffrey Yemin [ 31/Jan/18 ]

In the absence of more specific issues with the 3.x exception hierarchy, closing this as Fixed.

Comment by Jeffrey Yemin [ 13/Mar/15 ]

A lot of work has been done on this in 3.0 but leaving the ticket open to note that it warrants further review.

Comment by Sam Perman [ 18/Jul/13 ]

Thanks for filing the ticket, Jeff. Getting our retry logic "just right" has been a series of trial and error experiments. It would be great if there was a best practice to start with and having a clean exception hierarchy would be a great first step.

Generated at Thu Feb 08 08:53:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.