Exceptions are used within the PHP Couchbase client library to
raise an error within an operation. The exceptions are all
inherited from the base CouchbaseException
class, or you can trap for specific exceptions. The error string
associated with the exception will provide more information
about the error.
For example:
try { $oo->touch("spoon", 1); } catch (CouchbaseException $e) { echo "Error: " + $e; }
The supported exceptions are listed below:
CouchbaseException
This is the base class of all of the exceptions thrown from the extension.
CouchbaseIllegalKeyException
The key provided to the operation is not legal (i.e. empty).
CouchbaseAuthenticationException
Authentication to the Couchbase cluster failed.
CouchbaseLibcouchbaseException
An error occurred within libcouchbase which is used by the PHP extension to communicate with the cluster.
CouchbaseServerException
An error occurred somewhere in the Couchbase Cluster.