Exception: ChatGPT::APIError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status_code = nil, error_type = nil) ⇒ APIError

Returns a new instance of APIError.



10
11
12
13
14
# File 'lib/chatgpt/errors.rb', line 10

def initialize(message = nil, status_code = nil, error_type = nil)
  @status_code = status_code
  @error_type = error_type
  super(message)
end

Instance Attribute Details

#error_typeObject (readonly)

Returns the value of attribute error_type.



8
9
10
# File 'lib/chatgpt/errors.rb', line 8

def error_type
  @error_type
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



8
9
10
# File 'lib/chatgpt/errors.rb', line 8

def status_code
  @status_code
end