Exception: Usps::Imis::Error::Response

Inherits:
Api
  • Object
show all
Defined in:
lib/usps/imis/error/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, metadata = {}) ⇒ Response

Returns a new instance of Response.



10
11
12
13
# File 'lib/usps/imis/error/response.rb', line 10

def initialize(response,  = {})
  @response = response
  super(message, )
end

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata.



8
9
10
# File 'lib/usps/imis/error/response.rb', line 8

def 
  @metadata
end

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/usps/imis/error/response.rb', line 7

def response
  @response
end

Instance Method Details

#bugsnag_meta_dataObject



15
16
17
# File 'lib/usps/imis/error/response.rb', line 15

def 
  .tap { |m| m[:api].merge!() }
end

#messageObject



19
20
21
22
23
24
25
# File 'lib/usps/imis/error/response.rb', line 19

def message
  [
    "#{self.class.name}: [#{status.to_s.upcase}] The iMIS API returned an error.",
    (.inspect if  != {}),
    body
  ].compact.join("\n")
end