Exception: MicroCMS::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- MicroCMS::APIError
- Defined in:
- lib/microcms.rb
Overview
APIError
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code:, body:) ⇒ APIError
constructor
A new instance of APIError.
- #inspect ⇒ Object
Constructor Details
#initialize(status_code:, body:) ⇒ APIError
Returns a new instance of APIError.
160 161 162 163 164 165 166 |
# File 'lib/microcms.rb', line 160 def initialize(status_code:, body:) @status_code = status_code @body = parse_body(body) = @body['message'] || 'Unknown error occured.' super() end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
158 159 160 |
# File 'lib/microcms.rb', line 158 def body @body end |
#status_code ⇒ Object
Returns the value of attribute status_code.
158 159 160 |
# File 'lib/microcms.rb', line 158 def status_code @status_code end |
Instance Method Details
#inspect ⇒ Object
168 169 170 |
# File 'lib/microcms.rb', line 168 def inspect "#<#{self.class.name} @status_code=#{status_code}, @body=#{body.inspect} @message=#{message.inspect}>" end |