Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public function __construct($calculatedMac, $expected, $rawJson)
 {
     parent::__construct("Got {$calculatedMac} and expected {$expected}: {$rawJson}");
 }
 public function __construct($message = "PDO Service Unavailable", $code = Response::STATUS_CODE_503, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public function __construct($calculated, $sentMac, array $data)
 {
     $string = json_encode($data);
     parent::__construct("Mac Validation Error Expected {$sentMac} got {$calculated} Data: " . $string);
 }
 /**
  * @param string $message
  * @param int $code
  * @param \Throwable $previous
  */
 public function __construct($message = '', $code = 0, \Throwable $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 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);
 }
 /**
  * @param string $missingSetting
  */
 public function __construct($missingSetting)
 {
     $this->missingSetting = $missingSetting;
     parent::__construct('A required setting is missing: ' . $missingSetting);
 }
Exemplo n.º 11
0
 public function __construct($url)
 {
     parent::__construct("URL is invalid: " . $url);
 }
Exemplo n.º 12
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);
 }
Exemplo n.º 13
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');
 }
Exemplo n.º 14
0
 public function __construct()
 {
     parent::__construct("Request Object has not been set or is invalid");
 }
Exemplo n.º 15
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($httpCode, $rawReponse)
 {
     parent::__construct("Non expected http code: " . $httpCode, $httpCode, $rawReponse, null, $httpCode);
 }
Exemplo n.º 17
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());
 }
Exemplo n.º 18
0
 public function __construct($vailidationResults)
 {
     $this->vailidationResults = $vailidationResults;
     parent::__construct("Validation did not pass");
 }
Exemplo n.º 19
0
 public function __construct($message = "Authorization Required", $code = Response::STATUS_CODE_401, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
Exemplo n.º 20
0
 public function __construct($filePath = '')
 {
     parent::__construct("File Could not be found: " . $filePath);
 }
Exemplo n.º 21
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;
 }
Exemplo n.º 22
0
 public function __construct($params)
 {
     parent::__construct("The following parameters were not provided or are empty: " . $params);
 }
Exemplo n.º 23
0
 public function __construct($message = "", \Exception $previous = null)
 {
     parent::__construct($message, 500, $previous);
 }
Exemplo n.º 24
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;
 }
Exemplo n.º 25
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);
 }
Exemplo n.º 26
0
 public function __construct($message = 'Bad Request', $code = Response::STATUS_CODE_400, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
Exemplo n.º 27
0
 public function __construct($curlErrorMessage, $curlErrorCode, $rawResponse)
 {
     parent::__construct($curlErrorMessage, $curlErrorCode, $rawResponse);
 }