From: Martin Kraemer Date: Fri, 16 Mar 2007 02:03:32 +0000 (+0000) Subject: Thrift: fix error with handling TApplicationException X-Git-Tag: 0.2.0~1411 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a7d6c3c142594b3ba2eb294c96b9ee3e48f20b75;p=common%2Fthrift.git Thrift: fix error with handling TApplicationException 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 --- diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc index 36dd8d95..d5689c6d 100644 --- a/compiler/cpp/src/generate/t_php_generator.cc +++ b/compiler/cpp/src/generate/t_php_generator.cc @@ -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; }