Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0-dp4
    • Fix Version/s: 1.1.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Description

      When you connect via the new Couchbase(...) is not a direct way to check for whether the connection failed.

      It is not possible to check getResultCode()/getResultMessage() since this provides a unintilized couchbase

        Issue Links

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

          Activity

          Hide
          mjackson Michael Jackson added a comment -

          1.0.x merged in just now, 1.1 has been in for a bit. Should be present in next released versions.

          Show
          mjackson Michael Jackson added a comment - 1.0.x merged in just now, 1.1 has been in for a bit. Should be present in next released versions.
          Hide
          mjackson Michael Jackson added a comment -

          (I believe all this needs for resolution is the 1.0.x changeset mentioned above to be merged into 1.0.x branch.)

          Show
          mjackson Michael Jackson added a comment - (I believe all this needs for resolution is the 1.0.x changeset mentioned above to be merged into 1.0.x branch.)
          Hide
          mjackson Michael Jackson added a comment -

          master branch changeset is merged in. 1.0.x changeset is here: http://review.couchbase.org/#/c/21487/

          Show
          mjackson Michael Jackson added a comment - master branch changeset is merged in. 1.0.x changeset is here: http://review.couchbase.org/#/c/21487/
          Hide
          mjackson Michael Jackson added a comment -

          As a side note, I have a 1.0.x backport of the changes above ready to roll once the master branch changes are approved/merged.

          Show
          mjackson Michael Jackson added a comment - As a side note, I have a 1.0.x backport of the changes above ready to roll once the master branch changes are approved/merged.
          Hide
          mjackson Michael Jackson added a comment -
          Show
          mjackson Michael Jackson added a comment - patch set in progress: http://review.couchbase.org/#/c/21433/
          Hide
          mnunberg Mark Nunberg added a comment -

          For this we'd probably need to change the ext code to return a valid couchbase object so that getResultCode can be called on it (to check for connection failures).

          For the non-oo variant (couchbase_connect) behavior should remain the same

          Additionally, all the code which now checks for the couchbase object to simply exist should be changed to check that the couchbase object is indeed connected (I believe lcb has a function for that, but if not we can set our own little flag in our php_couchbase_ctx structure).

          One workaround is to call set_error_handler and make it throw an ErrorException right before instantiation. Then the connection can be done in a try/catch block, with any message being found in $ex->getMessage().

          I believe there may be ther workarounds as well

          Show
          mnunberg Mark Nunberg added a comment - For this we'd probably need to change the ext code to return a valid couchbase object so that getResultCode can be called on it (to check for connection failures). For the non-oo variant (couchbase_connect) behavior should remain the same Additionally, all the code which now checks for the couchbase object to simply exist should be changed to check that the couchbase object is indeed connected (I believe lcb has a function for that, but if not we can set our own little flag in our php_couchbase_ctx structure). One workaround is to call set_error_handler and make it throw an ErrorException right before instantiation. Then the connection can be done in a try/catch block, with any message being found in $ex->getMessage(). I believe there may be ther workarounds as well

            People

            • Assignee:
              mjackson Michael Jackson
              Reporter:
              akadna Dan Andersen
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes