public static convertExceptionToError ( |
||
$exception | the exception to convert to a PHP error. |
public static function convertExceptionToError($exception)
{
trigger_error(static::convertExceptionToString($exception), E_USER_ERROR);
}
/** * PHP magic method that returns the string representation of this object. * @return string the string representation of this object. */ public function __toString() { // __toString cannot throw exception // use trigger_error to bypass this limitation try { return $this->toString(); } catch (\Exception $e) { ErrorHandler::convertExceptionToError($e); return ''; } }