Sha256: 64b707c6c47f6129afe2b5c58a9abaa5476bc368a057a68d678709e2fd241439

Contents?: true

Size: 553 Bytes

Versions: 6

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true

module FmRest
  module Spyke
    module Model
      module Rescuable
        extend ::ActiveSupport::Concern

        include ::ActiveSupport::Rescuable

        class_methods do
          def request(*args)
            begin
              super
            rescue => e
              rescue_with_handler(e) || raise
            end
          end

          def rescue_account_error(with: nil, &block)
            rescue_from APIError::AccountError, with: with, &block
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fmrest-spyke-0.18.0.rc3 lib/fmrest/spyke/model/rescuable.rb
fmrest-spyke-0.18.0.rc2 lib/fmrest/spyke/model/rescuable.rb
fmrest-spyke-0.18.0.rc1 lib/fmrest/spyke/model/rescuable.rb
fmrest-spyke-0.17.1 lib/fmrest/spyke/model/rescuable.rb
fmrest-spyke-0.17.0 lib/fmrest/spyke/model/rescuable.rb
fmrest-spyke-0.17.0.rc1 lib/fmrest/spyke/model/rescuable.rb