Exception: Mindee::HTTP::Error::MindeeHttpError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/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)


105
106
107
108
109
110
111
# File 'lib/mindee/http/error.rb', line 105

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)


96
97
98
# File 'lib/mindee/http/error.rb', line 96

def api_code
  @api_code
end

#api_detailsString (readonly)

Returns:

  • (String)


98
99
100
# File 'lib/mindee/http/error.rb', line 98

def api_details
  @api_details
end

#api_messageString (readonly)

Returns:

  • (String)


100
101
102
# File 'lib/mindee/http/error.rb', line 100

def api_message
  @api_message
end

#status_codeString (readonly)

Returns:

  • (String)


94
95
96
# File 'lib/mindee/http/error.rb', line 94

def status_code
  @status_code
end