Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: PHP 1.1
Community Wiki and Resources
Wiki: PHP Client Library
PHP Client Library
Couchbase Developer Guide 2.0
Couchbase Server Manual 2.0
SDK Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
3 PHP Method Summary
Chapter Sections
Chapters

3.1. Error Handling

3.1.1. Exceptions
3.1.2. Error Codes and Constants

Error handling with the Couchbase PHP interface is currently handled using a combination of return values, exceptions and error codes. Return values are used for operations such as get(), which returns the corresponding document value if successful, or false if the document could not be found.

An explicit error code system is available when you want to identify specific errors, but the methods to obtain these must be called immediately after each operation to identify a specific failure. These methods are deprecated in place of the PHP exception mechanism and may be removed in a future release.

All the interface calls support exceptions and will raise a specific or generic Couchbase exception if an operation fails. For more information on the exceptions supported, see Section 3.1.1, “Exceptions”. Operations also raise a result code which can be obtained by calling the getResultCode() method immediately after an operation. Constants are provided to identify specific error conditions. See Section 3.1.2, “Error Codes and Constants” for more information.