Exception: RDF::LDP::RequestError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/rdf/ldp.rb

Overview

A base class for HTTP request errors.

This and its subclasses are caught and handled by Rack::LDP middleware. When a ‘RequestError` is caught by server middleware, its `#status` can be used as a response code and `#headers` may be added to (or replace) the existing HTTP headers.

Constant Summary collapse

STATUS =
500

Instance Method Summary collapse

Instance Method Details

#headersObject



53
54
55
56
57
# File 'lib/rdf/ldp.rb', line 53

def headers
  uri =
    'https://github.com/no-reply/rdf-ldp/blob/master/CONSTRAINED_BY.md'
  { 'Link' => "<#{uri}>;rel=\"#{CONSTRAINED_BY}\"" }
end

#statusObject



49
50
51
# File 'lib/rdf/ldp.rb', line 49

def status
  self.class::STATUS
end