/** * Constructor. * * @param string $message * @param string $code * @param string $httpBody * @param integer $httpCode * * @return void */ function __construct($message = null, $code = 0, $httpBody = null, $httpCode = 0) { $this->httpBody = $httpBody; $this->httpCode = $httpCode; $message = sprintf($this->message, $httpCode); parent::__construct($message, $code); }
/** * Builds a new TailException object. * * @param string $filename the name of the file * @param int $nblines the number of lines wanted * @param int $hint an estimation of the median number of characters per line * @param string $message the message of the exception * @param int $code the error code associated to this exception */ public function __construct($filename, $nblines, $hint, $message, $code) { parent::__construct($message, $code); $this->_filename = $filename; $this->_nblines = $nblines; $this->_hint = $hint; }
function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) { switch ($fn) { case 'EXECUTE': $this->sql = $p1; $this->params = $p2; $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}(\"{$p1}\")\n"; break; case 'PCONNECT': case 'CONNECT': $user = $thisConnection->user; $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, '{$user}', '****', {$p2})\n"; break; default: $s = "{$dbms} error: [{$errno}: {$errmsg}] in {$fn}({$p1}, {$p2})\n"; break; } $this->dbms = $dbms; if ($thisConnection) { $this->host = $thisConnection->host; $this->database = $thisConnection->database; } $this->fn = $fn; $this->msg = $errmsg; if (!is_numeric($errno)) { $errno = -1; } parent::__construct($s, $errno); }
public function __construct($message, $file, $line) { $message .= " in {$file} on line {$line}"; parent::__construct($message); $this->file = $file; $this->line = $line; }
public function __construct($message = null, $code = null, Exception $previous = null) { $message = $message ?: 'Please make sure you either provide an Eloquent Model Class as the 3rd argument or use this inside an Eloquent Model'; $code = $code ?: 403; // make sure everything is assigned properly parent::__construct($message, $code, $previous); }
/** * Constructor. * * @param string $message Message default = ''. * @param integer $code Code default = 404. * @param mixed $debug Debug default = null. */ public function __construct($message = '', $code = 404, $debug = null) { if (empty($message)) { $message = __('The requested page could not be found or is not currently accessible.'); } parent::__construct($message, $code, $debug); }
/** * Make a new API Exception with the given result. * * @param Array $result the result from the API server */ public function __construct($result) { $this->result = $result; $code = isset($result['error_code']) ? $result['error_code'] : 0; $msg = isset($result['error']) ? $result['error']['message'] : $result['error_msg']; parent::__construct($msg, $code); }
/** * Create a new AnewtException. * * \param $fmt * A error message, optionally with sprintf format specifiers * \param $args * Zero or more values passed to vsprintf */ function __construct($fmt, $args = null) { $args = func_get_args(); $fmt = array_shift($args); assert('is_string($fmt);'); parent::__construct(vsprintf($fmt, $args)); }
/** * Constructor * * @param string $message If no message is given 'Method Not Allowed' will be the message * @param int $code Status code, defaults to 405 */ public function __construct($message = null, $code = 405) { if (empty($message)) { $message = 'Method Not Allowed'; } parent::__construct($message, $code); }
public function __construct(&$Variable, array $arrRequireTypes = array(), $sVarName = null) { $this->Variable =& $Variable; $this->sVarName = $sVarName; $this->arrRequireTypes =& $arrRequireTypes; parent::__construct("变量%s类型为:%s,不满足要求的类型: %s", array($this->sVarName ?: '', Type::reflectType($this->Variable), implode(",", $this->arrRequireTypes))); }
/** * Constructor. * * @param string $message * @param integer $code * @param string $file * @param integer $line * @param array $trace */ public function __construct($message, $code, $file, $line, $trace) { parent::__construct($message, $code); $this->file = $file; $this->line = $line; $this->trace = $trace; }
/** * Constructor * * @param string $message If no message is given 'Unauthorized' will be the message * @param int $code Status code, defaults to 401 */ public function __construct($message = null, $code = 401) { if (empty($message)) { $message = 'Unauthorized'; } parent::__construct($message, $code); }
public function __construct($className, $message = null, \Exception $previous = null, $code = 0) { if (is_null($message)) { $message = sprintf("Class is not an interactor: %s", $className); } parent::__construct($message, $code, $previous); }
public function __construct($message, $code, $query = '') { parent::__construct($message, $code); $this->last_query = $query; $this->error = $message; $this->errno = $code; }
public function __construct($msg, $domain = null, $params = []) { $this->msgId = $msg; $this->msgDomain = $domain; $this->msgParams = $params; parent::__construct($msg); }
public function __construct($message, $code, $file_name, $http_method, $request_url, Exception $previous = null) { $this->file_name = $file_name; $this->http_method = $http_method; $this->request_url = $request_url; parent::__construct($message, $code, $previous); }
public function __construct(\PDOException $previous = null) { $info = $previous->errorInfo; $code = $info[1]; $message = $info[2]; parent::__construct($message, $code, $previous); }
/** * @param string $messages,... */ public function __construct(...$messages) { if (count($messages) > 1) { $this->subject = $messages[0]; } parent::__construct(implode(' - ', $messages)); }
/** * Creates a new translated exception. * * @param string error message * @param array translation variables */ public function __construct($message, array $variables = NULL, $code = 0) { // Set the message $message = __($message, $variables); // Pass the message to the parent parent::__construct($message, $code); }
public function __construct($message = null, $code = 0, $file = null, $line = null, $context = array()) { parent::__construct($message, $code); $this->file = $file; $this->line = $line; $this->context = $context; }
public function __construct($message, $code = 0, $exception = NULL) { if ($exception && get_class($exception) == 'RedisException' && $message == 'read error on connection') { $code = CredisException::CODE_DISCONNECTED; } parent::__construct($message, $code, $exception); }
public function __construct($message = null, $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); if (Configuration::getVerbose() >= 1) { Sonic::getLogger()->addError($message); } }
/** * Represents a complex exception thrown in Q. It may contain more details. * @class Q_Exception * @constructor * @extends Exception * @param {array} [$params=array()] Array of parameters for the exception. * Used in the exception message, etc. * To access them later, call $e->params() * You can also provide a string here, which will * then be the exception message. * @param {array} [$inputFields=array()] Array of names of input fields to which the exception applies. * @param {array} [$code=null] Optionally pass the error code here to override the default */ function __construct($params = array(), $inputFields = array(), $code = null, $file = null, $line = null, $trace = null, $traceAsString = null) { if (is_string($inputFields)) { $inputFields = array($inputFields); } $this->inputFields = $inputFields; if (isset($file)) { $this->file = $file; } if (isset($line)) { $this->line = $line; } if (isset($trace)) { $this->trace = $trace; } if (isset($traceAsString)) { $this->traceAsString = $traceAsString; } if (is_string($params)) { parent::__construct($params, isset($code) ? $code : 1); return; } $this->params = is_array($params) ? $params : array(); $className = get_class($this); $message = isset(self::$messages[$className]) ? Q::interpolate(self::$messages[$className], $this->params) : $className; $code = isset($code) ? $code : (isset(self::$codes[$className]) ? self::$codes[$className] : 1); parent::__construct($message, $code); }
public function __construct($message = null, $code = 0) { if (!$message) { throw new $this('Unknown ' . get_class($this)); } parent::__construct($message, $code); }
/** * Make a new API Exception with the given result. * * @param array $result The result from the API server */ public function __construct($result) { $this->result = $result; $code = 0; if (isset($result['error_code']) && is_int($result['error_code'])) { $code = $result['error_code']; } if (isset($result['error_description'])) { // OAuth 2.0 Draft 10 style $msg = $result['error_description']; } else { if (isset($result['error']) && is_array($result['error'])) { // OAuth 2.0 Draft 00 style $msg = $result['error']['message']; } else { if (isset($result['error_msg'])) { // Rest server style $msg = $result['error_msg']; } else { $msg = 'Unknown Error. Check getResult()'; } } } parent::__construct($msg, $code); }
/** * Public class constructor method * * @param string $message the exception message * @param \Msl\RemoteHost\Request\AbstractActionRequest $actionRequest the action request object */ public function __construct($message, \Msl\RemoteHost\Request\AbstractActionRequest $actionRequest) { // Calling parent constructor parent::__construct($message); // Setting object fields $this->actionRequest = $actionRequest; }
/** * Constructor. * * @param int $status HTTP status code * @param string $message Exception message * @param int $code Exception code * @param Exception $previous Previous exception used for exception chaining */ public function __construct($status = 0, $message = '', $code = 0, $previous = null) { // Set the status code $this->statusCode = $status; // Construct the parent class parent::__construct(trim($message), $code, $previous); }
public function __construct($status, $url, DOMDocument $document) { $this->document = $document; $this->url = $url; $this->status = $status; parent::__construct(sprintf("Error occured while trying to access '%s'.", $url)); }
public function __construct($alias) { $message = "Invalid alias: '{$alias}'"; $code = 500; $previous = null; parent::__construct($message, $code, $previous); }
/** * Exception constructor. * * @param string $requested_method The request HTTP method. * @param string $requested_uri The request URi. * @param array $allowed_methods All the allowed HTTP methods and routes for the request. * @param string $message The exception error message. * @param integer $code The exception error code. */ public function __construct($requested_method, $requested_uri, array $allowed_methods, $message = null, $code = 405) { $this->requested_method = $requested_method; $this->requested_uri = $requested_uri; $this->allowed_methods = $allowed_methods; parent::__construct($message, $code); }