Proper exception types in PHP thrift
Reviewed By: tbr-aditya
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665018 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/protocol/TProtocol.php b/lib/php/src/protocol/TProtocol.php
index 9519604..d95c26c 100644
--- a/lib/php/src/protocol/TProtocol.php
+++ b/lib/php/src/protocol/TProtocol.php
@@ -9,6 +9,8 @@
* @author Aditya Agarwal <aditya@facebook.com>
*/
+include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
+
/**
* Data types that can be sent via Thrift
*/
@@ -41,6 +43,20 @@
}
/**
+ * Protocol exceptions
+ */
+class TProtocolException extends TException {
+ const UNKNOWN = 0;
+ const INVALID_DATA = 1;
+ const NEGATIVE_SIZE = 2;
+ const SIZE_LIMIT = 3;
+
+ function __construct($message=null, $code=0) {
+ parent::__construct($message, $code);
+ }
+}
+
+/**
* Protocol base class module.
*/
abstract class TProtocol {