示例#1
0
 public function __construct($code, $jsonResponse)
 {
     $jsonError = "Unknown";
     switch ($code) {
         case JSON_ERROR_NONE:
             $jsonError = 'No errors';
             break;
         case JSON_ERROR_DEPTH:
             $jsonError = 'Maximum stack depth exceeded';
             break;
         case JSON_ERROR_STATE_MISMATCH:
             $jsonError = 'Underflow or the modes mismatch';
             break;
         case JSON_ERROR_CTRL_CHAR:
             $jsonError = 'Unexpected control character found';
             break;
         case JSON_ERROR_SYNTAX:
             $jsonError = 'Syntax error, malformed JSON';
             break;
         case JSON_ERROR_UTF8:
             $jsonError = 'Malformed UTF-8 characters, possibly incorrectly encoded';
             break;
     }
     $this->rawString = $jsonResponse;
     parent::__construct("Json Decode Error ({$jsonError}) For : {$jsonResponse}", $code);
 }
 /**
  * Creates a new exception
  *
  * @param string $invalidSetting The name of the invalid setting
  * @param string $details Optional additional details of the exception
  */
 public function __construct($invalidSetting, $details = '')
 {
     $this->invalidSetting = $invalidSetting;
     $message = 'This setting has an invalid value: ' . $invalidSetting;
     $message .= strlen($details) ? '. ' . $details : '';
     parent::__construct($message);
 }
示例#3
0
 public function __construct($message = 'The specified resource does not exist.', $code = Response::STATUS_CODE_404, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 public function __construct($message = "PDO Service Unavailable", $code = Response::STATUS_CODE_503, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
示例#5
0
 /**
  * Constructs a new IllegalArgumentException object.
  *
  * @param
  *            string exception message
  * @param
  *            int user defined exception code
  */
 public function __construct($message = NULL, $code = 0)
 {
     parent::__construct($message, $code);
 }
示例#6
0
 /**
  * @param int    $errorCode
  * @param string $errorMessage
  * @param string $argumentName
  * @param string $responseString
  */
 public function __construct($errorCode, $errorMessage, $argumentName, $responseString)
 {
     $this->argumentName = $argumentName;
     parent::__construct($errorCode, $errorMessage, $responseString);
 }
 /**
  * Public constructor that accepts the message string
  *
  * @link http://php.net/manual/en/exception.construct.php
  *
  * @param $message [optional]
  * @param $code [optional]
  * @param $previous [optional]
  *
  * @return  null
  */
 public function __construct($message, $code = null, $previous = null)
 {
     parent::init($message, $code, $previous);
 }
 public function __construct($filePath = '')
 {
     parent::__construct("File Could not be found: " . $filePath);
 }
示例#9
0
 public function __construct($vailidationResults)
 {
     $this->vailidationResults = $vailidationResults;
     parent::__construct("Validation did not pass");
 }
示例#10
0
 /**
  * Construct Exception
  *
  * @param \Elastica\Request $request
  * @param \Elastica\Response $response
  */
 public function __construct(Request $request, Response $response)
 {
     $this->_request = $request;
     $this->_response = $response;
     parent::__construct($response->getError());
 }
 /**
  * @param string $missingSetting
  */
 public function __construct($missingSetting)
 {
     $this->missingSetting = $missingSetting;
     parent::__construct('A required setting is missing: ' . $missingSetting);
 }
示例#12
0
 public function __construct($url)
 {
     parent::__construct("URL is invalid: " . $url);
 }
示例#13
0
 /**
  * Slight reordering of arguments from abstract.
  *
  * @param null $data
  * @param string $message
  * @param null $code
  */
 public function __construct($data = null, $message = 'Parse error', $code = -32700)
 {
     parent::__construct($message, $code, $data);
 }
示例#14
0
 /**
  * Construct Exception
  *
  * @param \Elastica\Response $response
  */
 public function __construct(Response $response)
 {
     $this->_response = $response;
     parent::__construct('Error in one or more bulk request actions');
 }
示例#15
0
 public function __construct()
 {
     parent::__construct("Request Object has not been set or is invalid");
 }
 public function __construct($httpCode, $rawReponse)
 {
     parent::__construct("Non expected http code: " . $httpCode, $httpCode, $rawReponse, null, $httpCode);
 }
 public function __construct($message = "The resource doesn't support the specified HTTP verb.", $code = Response::STATUS_CODE_405, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
示例#18
0
 public function __construct($message = "Authorization Required", $code = Response::STATUS_CODE_401, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 /**
  * @param string $message
  * @param int $code
  * @param \Throwable $previous
  */
 public function __construct($message = '', $code = 0, \Throwable $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
示例#20
0
 /**
  * Constructor
  *
  * @param String  $message
  * @param Integer $code
  * @param String  $host
  * @param String  $database
  */
 public function __construct($message, $code, $host, $database)
 {
     parent::__construct($message, $code);
     $this->_host = $host;
     $this->_database = $database;
 }
示例#21
0
 public function __construct($calculated, $sentMac, array $data)
 {
     $string = json_encode($data);
     parent::__construct("Mac Validation Error Expected {$sentMac} got {$calculated} Data: " . $string);
 }
示例#22
0
 public function __construct($message = "", \Exception $previous = null)
 {
     parent::__construct($message, 500, $previous);
 }
示例#23
0
 public function __construct($params)
 {
     parent::__construct("The following parameters were not provided or are empty: " . $params);
 }
示例#24
0
 /**
  * Construct Exception
  *
  * @param string            $message    Message
  * @param \Elastica\Request  $request
  * @param \Elastica\Response $response
  */
 public function __construct($message, Request $request = null, Response $response = null)
 {
     $this->_request = $request;
     $this->_response = $response;
     parent::__construct($message);
 }
示例#25
0
 /**
  * Constructor
  *
  * @param String       $message Error message
  * @param Integer|null $code Error code
  * @param String|null  $query The sql query that caused the error
  */
 public function __construct($message, $code = null, $query = null)
 {
     parent::__construct($message, $code);
     $this->_query = $query;
 }
示例#26
0
 public function __construct($calculatedMac, $expected, $rawJson)
 {
     parent::__construct("Got {$calculatedMac} and expected {$expected}: {$rawJson}");
 }
示例#27
0
 public function __construct($message = 'Bad Request', $code = Response::STATUS_CODE_400, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
示例#28
0
 public function __construct($curlErrorMessage, $curlErrorCode, $rawResponse)
 {
     parent::__construct($curlErrorMessage, $curlErrorCode, $rawResponse);
 }