/**
  * Construct the new exception instance
  *
  * @param string $path
  */
 public function __construct($path)
 {
     if (empty($message)) {
         $message = "File '{$path}' is not readable";
     }
     parent::__construct($message);
 }
 /**
  * @param string          $message
  * @param \Exception|null $previous
  */
 public function __construct($message = null, $previous = null)
 {
     if (empty($message)) {
         $message = 'Failed to authenticate';
     }
     parent::__construct($message, 0, $previous);
 }
 /**
  * Construct the new exception instance
  *
  * @param string $message
  */
 public function __construct($message = null)
 {
     if (empty($message)) {
         $message = 'API wrapper is not initialized. Please set proper API URL and key';
     }
     parent::__construct($message);
 }
 /**
  * Construct the new exception instance
  *
  * @param integer $http_code
  * @param string $server_response
  * @param float|null $request_time
  * @param string $message
  */
 public function __construct($http_code, $server_response = null, $request_time = null, $message = null)
 {
     $this->http_code = $http_code;
     $this->request_time = $request_time;
     if ($server_response && substr($server_response, 0, 1) === '{') {
         $this->server_response = json_decode($server_response, true);
     } else {
         $this->server_response = $server_response;
     }
     if ($message === null) {
         switch ($http_code) {
             case self::BAD_REQUEST:
                 $message = 'Bad Request';
                 break;
             case self::UNAUTHORIZED:
                 $message = 'Unauthorized';
                 break;
             case self::FORBIDDEN:
                 $message = 'Forbidden';
                 break;
             case self::NOT_FOUND:
                 $message = 'Not Found';
                 break;
             case self::INVALID_PROPERTIES:
                 $message = 'Invalid Properties';
                 break;
             case self::CONFLICT:
                 $message = 'Conflict';
                 break;
             case self::OPERATION_FAILED:
                 $message = 'Operation failed';
                 break;
             case self::UNAVAILABLE:
                 $message = 'Unavailable';
                 break;
             default:
                 $message = 'Unknown HTTP error';
         }
         if (is_array($this->server_response)) {
             $message .= '. Error (' . $this->server_response['type'] . '): ' . $this->server_response['message'];
         } else {
             $message .= '. Error: ' . $this->server_response;
         }
     }
     parent::__construct($message);
 }
 /**
  * Construct the new exception instance.
  *
  * @param int        $http_code
  * @param string     $server_response
  * @param float|null $request_time
  * @param string     $message
  */
 public function __construct($http_code, $server_response = null, $request_time = null, $message = null)
 {
     $this->http_code = $http_code;
     if ($server_response && substr($server_response, 0, 1) === '{') {
         $this->server_response = json_decode($server_response, true);
     } else {
         $this->server_response = $server_response;
     }
     $this->request_time = $request_time;
     if (empty($message)) {
         if (isset($this->http_codes[$http_code])) {
             $message = 'HTTP error ' . $http_code . ': ' . $this->http_codes[$http_code];
         } else {
             $message = 'Unknown HTTP error';
         }
     }
     parent::__construct($message);
 }
 /**
  * @param string $code
  */
 public function __construct($code)
 {
     switch ($code) {
         case 1:
             $message = 'Client details not set';
             break;
         case 2:
             $message = 'Unknown user';
             break;
         case 3:
             $message = 'Invalid Password';
             break;
         case 4:
             $message = 'Not allowed for given User and their System Role';
             break;
         default:
             $message = 'Unknown error';
     }
     parent::__construct($message);
 }