Exception: CrmpClient::HttpError

Inherits:
CrmpClientError show all
Defined in:
lib/crmp_client/errors.rb

Overview

Class to wrap errors caused by unexpected HTTP status codes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, body) ⇒ HttpError

Returns a new instance of HttpError.



11
12
13
14
15
# File 'lib/crmp_client/errors.rb', line 11

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/crmp_client/errors.rb', line 9

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/crmp_client/errors.rb', line 9

def code
  @code
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/crmp_client/errors.rb', line 17

def message
  "HTTP code [#{@code}], response cody [#{@body}]"
end