Exception: Sqreen::Kit::HttpClient::UnexpectedStatusError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sqreen/kit/http_client/unexpected_status_error.rb

Direct Known Subclasses

AuthenticationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, body = nil) ⇒ UnexpectedStatusError

Returns a new instance of UnexpectedStatusError.



12
13
14
15
# File 'lib/sqreen/kit/http_client/unexpected_status_error.rb', line 12

def initialize(code, body = nil)
  @code = code
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/sqreen/kit/http_client/unexpected_status_error.rb', line 10

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/sqreen/kit/http_client/unexpected_status_error.rb', line 10

def code
  @code
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/sqreen/kit/http_client/unexpected_status_error.rb', line 17

def message
  "Unexpected status #{code}: #{body}"
end