Exception: OpenAI::Errors::ConversionError
- Defined in:
- lib/openai/errors.rb
Instance Method Summary collapse
- #cause ⇒ StandardError?
-
#initialize(on:, method:, target:, value:, cause: nil) ⇒ ConversionError
constructor
private
A new instance of ConversionError.
Constructor Details
#initialize(on:, method:, target:, value:, cause: nil) ⇒ ConversionError
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 ConversionError.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/openai/errors.rb', line 25 def initialize(on:, method:, target:, value:, cause: nil) cls = on.name.split("::").last = [ "Failed to parse #{cls}.#{method} from #{value.class} to #{target.inspect}.", "To get the unparsed API response, use #{cls}[#{method.inspect}].", cause && "Cause: #{cause.}" ].filter(&:itself).join(" ") @cause = cause super() end |
Instance Method Details
#cause ⇒ StandardError?
16 |
# File 'lib/openai/errors.rb', line 16 def cause = @cause.nil? ? super : @cause |