From 43721320d7758252025be98ccd24da247edc323a Mon Sep 17 00:00:00 2001 From: Ma Bingyao Date: Sun, 19 Mar 2017 11:04:22 +0800 Subject: [PATCH] Improved debug message. --- src/Hprose/Service.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Hprose/Service.php b/src/Hprose/Service.php index 8500b33f..7716b107 100644 --- a/src/Hprose/Service.php +++ b/src/Hprose/Service.php @@ -14,7 +14,7 @@ * * * hprose service class for php 5.3+ * * * - * LastModified: Mar 10, 2017 * + * LastModified: Mar 19, 2017 * * Author: Ma Bingyao * * * \**********************************************************/ @@ -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) {