Exception: Tilia::Dav::Exception::PreconditionFailed
- Inherits:
-
Tilia::Dav::Exception
- Object
- StandardError
- Tilia::Dav::Exception
- Tilia::Dav::Exception::PreconditionFailed
- Defined in:
- lib/tilia/dav/exception/precondition_failed.rb
Overview
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)
Direct Known Subclasses
Tilia::DavAcl::Exception::NoAbstract, Tilia::DavAcl::Exception::NotRecognizedPrincipal, Tilia::DavAcl::Exception::NotSupportedPrivilege
Instance Attribute Summary collapse
-
#header ⇒ Object
When this exception is thrown, the header-name might be set.
Instance Method Summary collapse
-
#http_code ⇒ Object
Returns the HTTP statuscode for this exception.
-
#initialize(header = nil) ⇒ PreconditionFailed
constructor
Create the exception.
-
#serialize(_server, error_node) ⇒ Object
This method allows the exception to include additional information into the WebDAV error response.
Methods inherited from Tilia::Dav::Exception
Constructor Details
#initialize(header = nil) ⇒ PreconditionFailed
Create the exception
22 23 24 |
# File 'lib/tilia/dav/exception/precondition_failed.rb', line 22 def initialize(header = nil) self.header = header end |
Instance Attribute Details
#header ⇒ Object
When this exception is thrown, the header-name might be set.
This allows the exception-catching code to determine which HTTP header caused the exception.
16 17 18 |
# File 'lib/tilia/dav/exception/precondition_failed.rb', line 16 def header @header end |
Instance Method Details
#http_code ⇒ Object
Returns the HTTP statuscode for this exception
29 30 31 |
# File 'lib/tilia/dav/exception/precondition_failed.rb', line 29 def http_code 412 end |
#serialize(_server, error_node) ⇒ Object
This method allows the exception to include additional information into the WebDAV error response
38 39 40 41 42 43 |
# File 'lib/tilia/dav/exception/precondition_failed.rb', line 38 def serialize(_server, error_node) if header prop = LibXML::XML::Node.new('s:header', header) error_node << prop end end |