Exception: Mindee::Errors::MindeeHTTPError

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

Overview

API HttpError

Direct Known Subclasses

MindeeHTTPClientError, MindeeHTTPServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_error, url, code) ⇒ MindeeHTTPError

Returns a new instance of MindeeHTTPError.

Parameters:

  • http_error (Hash)
  • url (String)
  • code (Integer)


21
22
23
24
25
26
27
# File 'lib/mindee/errors/mindee_http_error.rb', line 21

def initialize(http_error, url, code)
  @status_code = code
  @api_code = http_error['code']
  @api_details = http_error['details']
  @api_message = http_error['message']
  super("#{url} #{@status_code} HTTP error: #{@api_details} - #{@api_message}")
end

Instance Attribute Details

#api_codeInteger (readonly)

Returns:

  • (Integer)


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

def api_code
  @api_code
end

#api_detailsString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/mindee/errors/mindee_http_error.rb', line 14

def api_details
  @api_details
end

#api_messageString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/mindee/errors/mindee_http_error.rb', line 16

def api_message
  @api_message
end

#status_codeString (readonly)

Returns:

  • (String)


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

def status_code
  @status_code
end