Exception: Anthropic::Errors::ConversionError
- Defined in:
- lib/anthropic/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.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/anthropic/errors.rb', line 22 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?
13 |
# File 'lib/anthropic/errors.rb', line 13 def cause = @cause.nil? ? super : @cause |