/** * Constructor. * * @param string $message The exception-message * @param int $code The code of the exception * @param Exception|null $previous The previous exception thrown - AS_OF: PHP 5.3 introduced ! * @param array $token A new token for exchange with client. * @param array $error An array containing detailed errors for each submitted field with validation set! * * @author Benjamin Carl <*****@*****.**> * @return \Doozr_Base_Rest_Exception * @access public */ public function __construct($message = null, $code = 0, $previous = null, array $token = null, array $error = null) { // Store error & token in this layer is a REST API thing! $this->setToken($token); $this->setError($error); // call parents constructor parent::__construct($message, $code, $previous); }
/** * Overrides parents constructor to add context to each exception of type: * Doozr_Kernel_Exception. * * @param string|null $message Exception message * @param int $code Code of the exception * @param Exception|null $previousException Previous exception thrown * * @author Benjamin Carl <*****@*****.**> */ public function __construct($message = null, $code = 0, $previousException = null) { // If no message set set => throw us again if (null === $message) { throw new $this(sprintf('Exception "%s" without message!', get_class($this))); } // Add context to message! $message = ($code == E_USER_CORE_FATAL_EXCEPTION ? 'Fatal: ' : '') . $message; parent::__construct($message, $code, $previousException); }
/** * Constructor. * * @param string $message Message of the exception * @param int $code Error-code of the exception * @param Exception $previous Previous thrown exception which should be repacked * * @author Benjamin Carl <*****@*****.**> * @access public */ public function __construct($message = null, $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); }