Exception: Mindee::Errors::MindeeHTTPErrorV2
- Inherits:
-
MindeeError
- Object
- StandardError
- MindeeError
- Mindee::Errors::MindeeHTTPErrorV2
- Defined in:
- lib/mindee/errors/mindee_http_error_v2.rb
Overview
API V2 HttpError
Instance Attribute Summary collapse
- #detail ⇒ String readonly
- #status ⇒ Integer readonly
Instance Method Summary collapse
-
#initialize(http_error) ⇒ MindeeHTTPErrorV2
constructor
A new instance of MindeeHTTPErrorV2.
Constructor Details
#initialize(http_error) ⇒ MindeeHTTPErrorV2
Returns a new instance of MindeeHTTPErrorV2.
15 16 17 18 19 20 21 22 23 |
# File 'lib/mindee/errors/mindee_http_error_v2.rb', line 15 def initialize(http_error) if http_error.is_a?(Parsing::V2::ErrorResponse) http_error = { 'detail' => http_error.detail, 'status' => http_error.status } end @status = http_error['status'] @detail = http_error['detail'] super("HTTP error: #{@status} - #{@detail}") end |
Instance Attribute Details
#detail ⇒ String (readonly)
12 13 14 |
# File 'lib/mindee/errors/mindee_http_error_v2.rb', line 12 def detail @detail end |
#status ⇒ Integer (readonly)
10 11 12 |
# File 'lib/mindee/errors/mindee_http_error_v2.rb', line 10 def status @status end |