Various Thrift fixes, including Application Exception support in Ruby, better errror messages across languages, etc.
Reviewed By: thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665058 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/transport/TPhpStream.php b/lib/php/src/transport/TPhpStream.php
index 8a4fb0a..03837a8 100644
--- a/lib/php/src/transport/TPhpStream.php
+++ b/lib/php/src/transport/TPhpStream.php
@@ -40,13 +40,13 @@
if ($this->read_) {
$this->inStream_ = @fopen('php://input', 'r');
if (!is_resource($this->inStream_)) {
- throw new Exception('TPhpStream: Could not open php://input');
+ throw new TException('TPhpStream: Could not open php://input');
}
}
if ($this->write_) {
$this->outStream_ = @fopen('php://output', 'w');
if (!is_resource($this->outStream_)) {
- throw new Exception('TPhpStream: Could not open php://output');
+ throw new TException('TPhpStream: Could not open php://output');
}
}
}
@@ -71,7 +71,7 @@
public function read($len) {
$data = @fread($this->inStream_, $len);
if (!$data) {
- throw new Exception('TPhpStream: Could not read '.$len.' bytes');
+ throw new TException('TPhpStream: Could not read '.$len.' bytes');
}
return $data;
}
@@ -80,7 +80,7 @@
while (strlen($buf) > 0) {
$got = @fwrite($this->outStream_, $buf);
if ($got === 0 || $got === FALSE) {
- throw new Exception('TPhpStream: Could not write '.strlen($buf).' bytes');
+ throw new TException('TPhpStream: Could not write '.strlen($buf).' bytes');
}
$buf = substr($buf, $got);
}