Exception: Doze::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Doze::Error
- Defined in:
- lib/doze/error.rb
Overview
Doze::Error wraps the data required to send an HTTP error response as an exception which Application and Responder infrastructure can raise.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(http_status = Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, message = '', headers = {}, backtrace = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(http_status = Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, message = '', headers = {}, backtrace = nil) ⇒ Error
Returns a new instance of Error.
3 4 5 6 7 8 |
# File 'lib/doze/error.rb', line 3 def initialize(http_status=Doze::Utils::STATUS_INTERNAL_SERVER_ERROR, ='', headers={}, backtrace=nil) @http_status = http_status @headers = headers @backtrace = backtrace super(Rack::Utils::HTTP_STATUS_CODES[http_status] + ( ? ": #{}" : '')) end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
14 15 16 |
# File 'lib/doze/error.rb', line 14 def headers @headers end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
14 15 16 |
# File 'lib/doze/error.rb', line 14 def http_status @http_status end |
Instance Method Details
#backtrace ⇒ Object
10 11 12 |
# File 'lib/doze/error.rb', line 10 def backtrace @backtrace || super end |