/** * Constructor for CloudFlareApiException. * * @param string $http_response_code * The HTTP response code returned from the request. We expect this to be * 200 or 301. Other error codes should be handled by * CloudFlareHttpException. * @param int $api_response_code * The response code returned from the CloudFlare API. * @param string $message * The user readable description of what went wrong. * @param \Exception $previous * If there were previous errors pass them along. */ public function __construct($http_response_code, $api_response_code, $message, \Exception $previous = NULL) { parent::__construct($message, $api_response_code, $previous); $this->httpResponseCode = $http_response_code; $this->apiResponseCode = $api_response_code; $this->message = $message; }
/** * Constructor for CloudFlareInvalidSettingValueException. * * @param string $field_name * The name of the field that was attempted to be set. * @param int $value * The value that was attempted to be set. * @param \Exception $previous * If this error was triggered by a previous exception passed that stack * information up. */ public function __construct($field_name, $value, \Exception $previous = NULL) { $value_as_string = ''; try { $value_as_string = (string) $value; } catch (\Exception $e) { $value_as_string = gettype($value) . 'type '; } $message = 'CloudFlarePhpSdk: The ' . $value_as_string . ' is not valid for ' . $field_name; parent::__construct($message, 0, $previous); $this->fieldName = $field_name; $this->invalidValue = $value; }
/** * Constructor for CloudFlareNotModifiableException. * * @param string $field_name * The field that was attempted to be altered. * @param \Exception $previous * The previous exceptions in the call stack. */ public function __construct($field_name, \Exception $previous = NULL) { $this->fieldName = $field_name; $this->message = "CloudFlarePhpSdk: The field {$field_name} is not editable."; parent::__construct($this->message, 0, $previous); }