/** * Create a new PHP error exception. * * @return void */ public function __construct($code, $error, $file, $line, $context = NULL) { parent::__construct($error); // Set the error code, file, line, and context manually $this->code = $code; $this->file = $file; $this->line = $line; }
/** * Set internal properties. * * @param string URI of page * @param string custom error template */ public function __construct($page = NULL) { if ($page === NULL) { // Use the complete URI $page = Router::$complete_uri; } parent::__construct(strtr('The page you requested, %page%, could not be found.', array('%page%' => $page))); }
/** * Sets exception message and debug info. * * @param string message * @param mixed debug info * @return void */ public function __construct($message, $debug = nil) { // Failure message parent::__construct("UnitTest Exception", (string) $message); // Extra user-defined debug info $this->debug = $debug; // Overwrite failure location $trace = $this->getTrace(); $this->file = $trace[0]['file']; $this->line = $trace[0]['line']; }
/** * Set exception title and message. * * @param string exception title string * @param string exception message string * @param string custom error template */ public function __construct($title, $message, array $variables = NULL) { parent::__construct($message, $variables); // Code is the error title $this->code = $title; }
public function __construct($message, $variables = NULL, $code = 0) { parent::__construct($message, $variables, $code); }