ZF-3338: Zend_Rest_Server faults with blank page
Description
The fault exception handler registered in the constructor fails to output anything (resulting inempty pages) because fault() is designed to return the DomDocument instead. Suggest to register an separate echoing handler for uncaught exceptions only.
/**
* Constructor
*/
public function __construct()
{
set_exception_handler(array($this, "echoFault"));
$this->_reflection = new Zend_Server_Reflection();
}
/**
* echo exception document
*
* registered handler when all else fails
*
* @param string|Exception $fault Message
* @param int $code Error Code
* @return DOMDocument
*/
public function echoFault($exception = null, $code = null)
{
echo $this->fault($exception,$code)->saveXML();
}
Comments
Posted by Wil Sinclair (wil) on 2008-06-01T13:23:55.000+0000
Assigning, updating to meet IT conventions, and resolving as a duplicate.
Posted by Wil Sinclair (wil) on 2008-06-01T13:25:18.000+0000
Please look for existing issues before creating a new one. If there is something I've missed here, feel free to reopen this issue with an explanation.