From: gggeek Date: Tue, 24 Mar 2015 13:58:33 +0000 (+0000) Subject: When serialize() is invoked on a response and its payload can not be serialized,... X-Git-Tag: 4.0.0-alpha^2~125 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c0e827c303b8228e64d461a9719ada6eaef7c61a;p=plcapi.git When serialize() is invoked on a response and its payload can not be serialized, an exception is thrown instead of ending all execution --- diff --git a/src/Response.php b/src/Response.php index 54e8db4a..626fd64f 100644 --- a/src/Response.php +++ b/src/Response.php @@ -105,6 +105,8 @@ class Response * @param string $charsetEncoding the charset to be used for serialization. if null, US-ASCII is assumed * * @return string the xml representation of the response + * + * @throws \Exception */ public function serialize($charsetEncoding = '') { @@ -134,7 +136,7 @@ class Response "\n"; } else { /// @todo try to build something serializable? - die('cannot serialize xmlrpc response objects whose content is native php values'); + throw new \Exception('cannot serialize xmlrpc response objects whose content is native php values'); } } else { $result .= "\n\n" .