Sha256: 20b6966c98b476841d2820c2cb523932ff6c01456bead12dc61245f1fef4f15d
Contents?: true
Size: 1.44 KB
Versions: 2
Compression:
Stored size: 1.44 KB
Contents
# frozen_string_literal: true module LedgerSync class Error class AdaptorError < Error attr_reader :adaptor attr_reader :response def initialize(adaptor:, message:, response:nil) @adaptor = adaptor @response = response super(message: message) end class MissingAdaptorError < self def initialize(message:) super( message: message, adaptor: nil, ) end end class AdaptorValidationError < self attr_reader :attribute, :validation def initialize(message:, adaptor:, attribute:, validation:) @attribute = attribute @validation = validation super( message: message, adaptor: adaptor, ) end end class ThrottleError < self attr_reader :rate_limiting_wait_in_seconds def initialize(adaptor:, message: nil, response:nil) message ||= 'Your request has been throttled.' @rate_limiting_wait_in_seconds = LedgerSync.adaptors.config_from_klass( klass: adaptor.class ).rate_limiting_wait_in_seconds super( adaptor: adaptor, message: message, response: response ) end end class AuthenticationError < self; end class AuthorizationError < self; end class ConfigurationError < self; end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ledger_sync-1.1.3 | lib/ledger_sync/error/adaptor_errors.rb |
ledger_sync-1.1.2 | lib/ledger_sync/error/adaptor_errors.rb |