Exception: MisarBlog::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- MisarBlog::ApiError
- Defined in:
- lib/misarblog/errors.rb
Overview
Raised when the Misar.Blog dev-API returns a non-2xx response.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, message, error_type = "api_error", body = nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(status, message, error_type = "api_error", body = nil) ⇒ ApiError
Returns a new instance of ApiError.
6 7 8 9 10 11 |
# File 'lib/misarblog/errors.rb', line 6 def initialize(status, , error_type = "api_error", body = nil) @status = status @error_type = error_type @body = body super("misar-blog: API error #{status} (#{error_type}): #{}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/misarblog/errors.rb', line 4 def body @body end |
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
4 5 6 |
# File 'lib/misarblog/errors.rb', line 4 def error_type @error_type end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/misarblog/errors.rb', line 4 def status @status end |