Skip to content

Commit

Permalink
Improved debug message.
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Mar 19, 2017
1 parent 0665e76 commit 4372132
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Hprose/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose service class for php 5.3+ *
* *
* LastModified: Mar 10, 2017 *
* LastModified: Mar 19, 2017 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -238,7 +238,11 @@ private function inputFilter($data, stdClass $context) {
$stream = new BytesIO();
$writer = new Writer($stream, true);
$stream->write(Tags::TagError);
$writer->writeString($this->debug ? $error->getTraceAsString() : $error->getMessage());
$errmsg = $error->getMessage();
if ($this->debug) {
$errmsg .= "\r\n" . $error->getTraceAsString();
}
$writer->writeString($errmsg);
return $stream;
}
public function endError($error, stdClass $context) {
Expand Down

0 comments on commit 4372132

Please sign in to comment.