When serialize() is invoked on a response and its payload can not be serialized,...
authorgggeek <giunta.gaetano@gmail.com>
Tue, 24 Mar 2015 13:58:33 +0000 (13:58 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 24 Mar 2015 13:58:33 +0000 (13:58 +0000)
src/Response.php

index 54e8db4..626fd64 100644 (file)
@@ -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
                         "</param>\n</params>";
                 } 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 .= "<params>\n<param>\n" .