[JAVA-687] MongoException should contain the host/port of the server it got an error from Created: 31/Oct/12 Updated: 31/Mar/15 Resolved: 25/Jun/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | None |
| Fix Version/s: | 3.0.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently if there is an application error in the server when executing, say, a command, the driver takes the error message from "err" and puts in it a MongoException, so you might see something like:
It would be useful in many cases to include the host and port of the server that generated the error, e.g.
|
| Comments |
| Comment by Jeffrey Yemin [ 31/Mar/15 ] | ||||
|
Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released. | ||||
| Comment by Jeffrey Yemin [ 25/Jun/13 ] | ||||
|
See https://github.com/jyemin/mongo-java-driver/commit/d52fa8a#L2R20. In 3.0.x branch there is a new class org.mongodb.MongoServerException which contains the ServerAddress as a property. | ||||
| Comment by Jeffrey Yemin [ 31/Oct/12 ] | ||||
|
The driver doesn't have any more information than this. The server's response to the command is something like:
That said, it would be good to make it very clear that that's the case. Currently the driver does not make it easy to determine whether a message like that is server-side generated or driver-generated (e.g. "can't say something" or "out of semaphores") | ||||
| Comment by Ryan Nitz [ 31/Oct/12 ] | ||||
|
It might be good to add a bit more information explaining what a writeback exception is #shrug |