Exception: OpenAI::Errors::APIError

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

Direct Known Subclasses

APIConnectionError, APIStatusError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil) ⇒ APIError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of APIError.



66
67
68
69
70
71
72
73
# File 'lib/openai/errors.rb', line 66

def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
  @url = url
  @status = status
  @body = body
  @request = request
  @response = response
  super(message)
end

Instance Attribute Details

#bodyObject?



47
48
49
# File 'lib/openai/errors.rb', line 47

def body
  @body
end

#codeString?



50
51
52
# File 'lib/openai/errors.rb', line 50

def code
  @code
end

#paramString?



53
54
55
# File 'lib/openai/errors.rb', line 53

def param
  @param
end

#statusInteger?



44
45
46
# File 'lib/openai/errors.rb', line 44

def status
  @status
end

#typeString?



56
57
58
# File 'lib/openai/errors.rb', line 56

def type
  @type
end

#urlURI::Generic



41
42
43
# File 'lib/openai/errors.rb', line 41

def url
  @url
end