Exception: CoverMyMeds::Error::HTTPError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/covermymeds_api/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message) ⇒ HTTPError

Returns a new instance of HTTPError.



5
6
7
8
# File 'lib/covermymeds_api/error.rb', line 5

def initialize status, message
  @status = status
  @error_json = message
end

Instance Attribute Details

#error_jsonObject (readonly)

Returns the value of attribute error_json.



14
15
16
# File 'lib/covermymeds_api/error.rb', line 14

def error_json
  @error_json
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/covermymeds_api/error.rb', line 14

def status
  @status
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/covermymeds_api/error.rb', line 10

def message
  "#{@status}: #{@error_json}"
end