Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-687

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: None
    • Component/s: Error Handling
    • Labels:
      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 Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: