ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\Exception\PreconditionFailed Class Reference

PreconditionFailed. More...

+ Inheritance diagram for Sabre\DAV\Exception\PreconditionFailed:
+ Collaboration diagram for Sabre\DAV\Exception\PreconditionFailed:

Public Member Functions

 __construct ($message, $header=null)
 Create the exception. More...
 
 getHTTPCode ()
 Returns the HTTP statuscode for this exception. More...
 
 serialize (DAV\Server $server, \DOMElement $errorNode)
 This method allows the exception to include additional information into the WebDAV error response. More...
 
- Public Member Functions inherited from Sabre\DAV\Exception
 getHTTPCode ()
 Returns the HTTP statuscode for this exception. More...
 
 serialize (Server $server, \DOMElement $errorNode)
 This method allows the exception to include additional information into the WebDAV error response. More...
 
 getHTTPHeaders (Server $server)
 This method allows the exception to return any extra HTTP response headers. More...
 

Data Fields

 $header = null
 

Detailed Description

PreconditionFailed.

This exception is normally thrown when a client submitted a conditional request, like for example an If, If-None-Match or If-Match header, which caused the HTTP request to not execute (the condition of the header failed)

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 18 of file PreconditionFailed.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\DAV\Exception\PreconditionFailed::__construct (   $message,
  $header = null 
)

Create the exception.

Parameters
string$message
string$header

Definition at line 36 of file PreconditionFailed.php.

References Sabre\DAV\Exception\PreconditionFailed\$header, and $message.

36  {
37 
38  parent::__construct($message);
39  $this->header = $header;
40 
41  }
catch(Exception $e) $message

Member Function Documentation

◆ getHTTPCode()

Sabre\DAV\Exception\PreconditionFailed::getHTTPCode ( )

Returns the HTTP statuscode for this exception.

Returns
int

Definition at line 48 of file PreconditionFailed.php.

48  {
49 
50  return 412;
51 
52  }

◆ serialize()

Sabre\DAV\Exception\PreconditionFailed::serialize ( DAV\Server  $server,
\DOMElement  $errorNode 
)

This method allows the exception to include additional information into the WebDAV error response.

Parameters
DAV\Server$server
\DOMElement$errorNode
Returns
void

Definition at line 61 of file PreconditionFailed.php.

References Sabre\DAV\Exception\PreconditionFailed\$header.

61  {
62 
63  if ($this->header) {
64  $prop = $errorNode->ownerDocument->createElement('s:header');
65  $prop->nodeValue = $this->header;
66  $errorNode->appendChild($prop);
67  }
68 
69  }

Field Documentation

◆ $header

Sabre\DAV\Exception\PreconditionFailed::$header = null

The documentation for this class was generated from the following file: