Yaf_Exception::__construct
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Construct a Yaf exception
Description
Yaf_Exception::__construct(string $message = "", int $code = 0)
Constructs a new Yaf_Exception. The code carries the Yaf error code that identifies the type of failure, and is exposed via Exception::getCode.
Parameters
messageThe exception message.
codeThe Yaf error code.
Return Values
No value is returned.
Examples
Yaf_Exception::__construct example
php
<?php
throw new Yaf_Exception(
"Failed to find the controller 'Product'",
YAF_ERR_NOTFOUND_CONTROLLER /* 516 */
);
?>The above example will output something similar to:
output
PHP Fatal error: Uncaught Yaf_Exception: Failed to find the controller 'Product' in /path/to/index.php:2See Also
Yaf_ExceptionYaf_Exception::getPreviousYaf_Exception_RouterFailed