Exception: TwelvedataRuby::EndpointError

Inherits:
Error
  • Object
show all
Defined in:
lib/twelvedata_ruby/error.rb

Overview

Base class for endpoint-related errors

Constant Summary

Constants inherited from Error

TwelvedataRuby::Error::DEFAULT_MESSAGES

Instance Attribute Summary

Attributes inherited from Error

#attributes, #original_error

Instance Method Summary collapse

Methods inherited from Error

#format_default_message

Constructor Details

#initialize(endpoint:, invalid:, **options) ⇒ EndpointError

Returns a new instance of EndpointError.



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/twelvedata_ruby/error.rb', line 53

def initialize(endpoint:, invalid:, **options)
  attributes = {
    name: endpoint.name,
    invalid: invalid,
    valid_names: endpoint.class.names.join(", "),
    parameters: endpoint&.parameters_keys&.join(", "),
    required: endpoint&.required_parameters&.join(", "),
  }

  super(attributes: attributes, **options)
end