Thrift: fix error with handling TApplicationException
authorMartin Kraemer <martin@apache.org>
Fri, 16 Mar 2007 02:03:32 +0000 (02:03 +0000)
committerMartin Kraemer <martin@apache.org>
Fri, 16 Mar 2007 02:03:32 +0000 (02:03 +0000)
Summary:
The php recv functions for method invocations didn't pass a proper input object into the handler for reading an application exception. This caused graceful thrift failures to not work gracefully in PHP.

Reviewed By: Slee

Test Plan: Tested by invoking from a thrift client a function not defined on a thrift server.  Should response with Invalid method name

Revert Plan: revertible

Notes:

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665061 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_php_generator.cc

index 36dd8d9..d5689c6 100644 (file)
@@ -1063,8 +1063,8 @@ void t_php_generator::generate_service_client(t_service* tservice) {
           indent() << "$this->input_->readMessageBegin($fname, $mtype, $rseqid);" << endl <<
           indent() << "if ($mtype == TMessageType::EXCEPTION) {" << endl <<
           indent() << "  $x = new TApplicationException();" << endl <<
-          indent() << "  $x->read($input);" << endl <<
-          indent() << "  $input->readMessageEnd();" << endl <<
+          indent() << "  $x->read($this->input_);" << endl <<
+          indent() << "  $this->input_->readMessageEnd();" << endl <<
           indent() << "  throw $x;" << endl <<
           indent() << "}" << endl;
       }