Exception: Showroom::ResponseError
- Defined in:
- lib/showroom/core/error.rb
Overview
Raised for HTTP responses with status >= 400.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ String?
readonly
raw response body.
-
#headers ⇒ Hash
readonly
response headers.
-
#status ⇒ Integer
readonly
HTTP status code.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil, headers: {}) ⇒ ResponseError
constructor
A new instance of ResponseError.
Constructor Details
#initialize(message = nil, status: nil, body: nil, headers: {}) ⇒ ResponseError
Returns a new instance of ResponseError.
28 29 30 31 32 33 |
# File 'lib/showroom/core/error.rb', line 28 def initialize( = nil, status: nil, body: nil, headers: {}) super( || "HTTP #{status}") @status = status @body = body @headers = headers end |
Instance Attribute Details
#body ⇒ String? (readonly)
raw response body
21 22 23 |
# File 'lib/showroom/core/error.rb', line 21 def body @body end |
#headers ⇒ Hash (readonly)
response headers
21 22 23 |
# File 'lib/showroom/core/error.rb', line 21 def headers @headers end |
#status ⇒ Integer (readonly)
HTTP status code
21 22 23 |
# File 'lib/showroom/core/error.rb', line 21 def status @status end |