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

No diagnostic of connect fault to database

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      That is fragment of Scala program that calls objects from com.mongodb.reactivestreams:

      val client = MongoClients.create()
      val db = client.getDatabase("test")

      db.listCollectionNames().subscribe(new Subscriber[String]

      {   def onSubscribe(s: Subscription) =  println("onSubscribe")   def onNext(elem: String) = println("onNext")   def onError(t: Throwable) = println("onError")   def onComplete() = println("onComplete") }

      )

       

      When database is not exist, I see on console:

      onSubscribe

      00:27:13.696 INFO  org.mongodb.driver.cluster - Exception in monitor thread while connecting to server localhost:27017
      00:27:13.696 

      ...

      But OnError is not called.

      How can I handle this error?

      Attachments

        Activity

          People

            Unassigned Unassigned
            akaplanov@gmail.com Andrew Kaplanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: