Exception: AILabTools::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/ailabtools/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code:, request_id: nil, log_id: nil, error_code: nil, error_detail: nil, raw: nil) ⇒ APIError

Returns a new instance of APIError.



11
12
13
14
15
16
17
18
19
# File 'lib/ailabtools/errors.rb', line 11

def initialize(message, status_code:, request_id: nil, log_id: nil, error_code: nil, error_detail: nil, raw: nil)
  super(message)
  @status_code = status_code
  @request_id = request_id
  @log_id = log_id
  @error_code = error_code
  @error_detail = error_detail
  @raw = raw
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def error_code
  @error_code
end

#error_detailObject (readonly)

Returns the value of attribute error_detail.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def error_detail
  @error_detail
end

#log_idObject (readonly)

Returns the value of attribute log_id.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def log_id
  @log_id
end

#rawObject (readonly)

Returns the value of attribute raw.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def raw
  @raw
end

#request_idObject (readonly)

Returns the value of attribute request_id.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def request_id
  @request_id
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



9
10
11
# File 'lib/ailabtools/errors.rb', line 9

def status_code
  @status_code
end