Exception: Mindee::Errors::MindeeHTTPErrorV2

Inherits:
MindeeError
  • Object
show all
Defined in:
lib/mindee/errors/mindee_http_error_v2.rb

Overview

API V2 HttpError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_error) ⇒ MindeeHTTPErrorV2

Returns a new instance of MindeeHTTPErrorV2.

Parameters:



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

#detailString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/mindee/errors/mindee_http_error_v2.rb', line 12

def detail
  @detail
end

#statusInteger (readonly)

Returns:

  • (Integer)


10
11
12
# File 'lib/mindee/errors/mindee_http_error_v2.rb', line 10

def status
  @status
end