Ejemplo n.º 1
0
 /**
  * Initializes the exception with the given $headerName, $value (the value
  * of the named header) and $expectedValue and sets the exception message
  * from it.
  * 
  * @param string $headerName    Name of the affected header.
  * @param string $value         Contained value.
  * @param string $expectedValue Expected values.
  * @return void
  */
 public function __construct($headerName, $value, $expectedValue = null)
 {
     $msg = "The value '{$value}' for the header '{$headerName}' is invalid.";
     if ($expectedValue !== null) {
         $msg .= " Allowed values are: " . $expectedValue . '.';
     }
     parent::__construct($msg);
 }
 /**
  * Initializes the exception with the given $method and $reason and sets
  * the exception message from it.
  * 
  * @param mixed $method 
  * @param mixed $reason 
  * @return void
  */
 public function __construct($method, $reason = null)
 {
     parent::__construct("The HTTP request body received for HTTP method '{$method}' was invalid." . ($reason !== null ? " Reason: {$reason}" : ''));
 }
Ejemplo n.º 3
0
 /**
  * Initializes the exception with the given $reason.
  * 
  * @param string $reason 
  * @return void
  */
 public function __construct($reason)
 {
     parent::__construct('Invalid XML. ' . $reason);
 }
Ejemplo n.º 4
0
 /**
  * Initializes the exception with the given $headerName and sets the exception
  * message from it.
  * 
  * @param string $headerName Name of the missing header.
  * @return void
  */
 public function __construct($headerName)
 {
     parent::__construct("The header '{$headerName}' is required by the request sent or the response to send but was not set.");
 }