MongoException should contain the host/port of the server it got an error from

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.0.0
    • Affects Version/s: None
    • Component/s: Error Handling
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:

      Caused by: com.mongodb.MongoException: writeback
      	at com.mongodb.CommandResult.getException(CommandResult.java:100) ~[mongo.jar:na]
      	at com.mongodb.CommandResult.throwOnError(CommandResult.java:134) ~[mongo.jar:na]
      

      It would be useful in many cases to include the host and port of the server that generated the error, e.g.

      Caused by: com.mongodb.MongoException: error: writeback, 
                                             server: localhost:30000
      	at com.mongodb.CommandResult.getException(CommandResult.java:100) ~[mongo.jar:na]
      	at com.mongodb.CommandResult.throwOnError(CommandResult.java:134) ~[mongo.jar:na]
      

            Assignee:
            Unassigned
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: