Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-140

Code breaks when Connection URI is improper

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1-dp3
    • Fix Version/s: 1.1.1
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Environment:

      Description

      The code breaks abruptly when connection URI is not given in a proper format in the SDK client for connecting the to required Couchbase server.
      For instance, when I am specifying the URI as "http:/10.3.2.57:8091/index.html" instead of "http:/10.3.2.57:8091/pools", exception appears,
      whereas a proper error message should be returned saying that 'Connection could not be established to the requested server location'.
      Please find attached the log file for the exception trace.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        deeptida Deepti Dawar added a comment -

        Mark, can we have any exceptions like DisplayableException which could be shown to the end user ?

        Can you please give details about the connection or execution exceptions.

        Show
        deeptida Deepti Dawar added a comment - Mark, can we have any exceptions like DisplayableException which could be shown to the end user ? Can you please give details about the connection or execution exceptions.
        Hide
        mnunberg Mark Nunberg added a comment -

        What is displayed to the user is a sub-component of logging and not of the exception itself. An exception is not an exception unless it represents an exceptional condition; it is up to the code catching the exception to convert this to something the user can understand.

        I am not sure if the Couchbase Java client has classes for "connection" exceptions which indicate a difficulty in communication between client and server, but if there isn't such a class then it should be created.

        Theroetically

        class CouchbaseConnectionException extends Exception

        { .... }

        Typically it seems most of the Couchbase exceptions in the Java client are RuntimeExceptions or ExecutionExceptions (i.e. generic "unchecked" exceptions).

        Matt and Michale might have more knowledge of the various classes contained therein and their suitability of use.

        Show
        mnunberg Mark Nunberg added a comment - What is displayed to the user is a sub-component of logging and not of the exception itself. An exception is not an exception unless it represents an exceptional condition; it is up to the code catching the exception to convert this to something the user can understand. I am not sure if the Couchbase Java client has classes for "connection" exceptions which indicate a difficulty in communication between client and server, but if there isn't such a class then it should be created. Theroetically class CouchbaseConnectionException extends Exception { .... } Typically it seems most of the Couchbase exceptions in the Java client are RuntimeExceptions or ExecutionExceptions (i.e. generic "unchecked" exceptions). Matt and Michale might have more knowledge of the various classes contained therein and their suitability of use.
        Hide
        deeptida Deepti Dawar added a comment - - edited

        I agree. There should be in-house exception classes meant to facilitate this purpose.
        A user working with couchbase sdk, should have the feasibility of using those exception classes for understanding various scenarios and then acting accordingly.

        Please let us know if there are any exception classes for communicating the connection exception to the user in which we can embed a custom message stating what happened.

        Show
        deeptida Deepti Dawar added a comment - - edited I agree. There should be in-house exception classes meant to facilitate this purpose. A user working with couchbase sdk, should have the feasibility of using those exception classes for understanding various scenarios and then acting accordingly. Please let us know if there are any exception classes for communicating the connection exception to the user in which we can embed a custom message stating what happened.
        Hide
        deeptida Deepti Dawar added a comment -
        Show
        deeptida Deepti Dawar added a comment - Please review at http://review.couchbase.org/#/c/23648/
        Hide
        deeptida Deepti Dawar added a comment -

        Changes checked in for review in gerrit.

        Show
        deeptida Deepti Dawar added a comment - Changes checked in for review in gerrit.

          People

          • Assignee:
            deeptida Deepti Dawar
            Reporter:
            deeptida Deepti Dawar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes