Create a new exception.
Parameters
$message
stringrequired- Exception message.
$type
stringrequired- Exception type.
$data
mixedoptional- Associated data, if applicable.
Default:
null
$code
intrequired- Exception numerical code, if applicable.
Source
public function __construct($message, $type, $data = null, $code = 0) {
if ($type !== null) {
$this->type = $type;
}
if ($code !== null) {
$this->code = (int) $code;
}
if ($message !== null) {
$this->reason = $message;
}
$message = sprintf('%d %s', $this->code, $this->reason);
parent::__construct($message, $this->type, $data, $this->code);
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.