Sha256: 48a77a877b3421692b092312fbf52ddff3e8269870972731a2d9c53a47a1ed84

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

module AfterbanksPSD2
  class Error < ::StandardError
    attr_reader :message, :debug_id

    def initialize(message:, debug_id:)
      super

      @message = message
      @debug_id = debug_id
    end

    def code
      raise 'Not implemented'
    end
  end

  class GenericError < Error
    def code
      1
    end
  end

  class IncorrectParametersError < Error
    def code
      50
    end
  end

  class GenericConsentError < Error
    def code
      'C000'
    end
  end

  class InvalidConsentError < Error
    def code
      'C001'
    end
  end

  class ConsentWithUnfinalizedProcessError < Error
    def code
      'C002'
    end
  end

  class ProductMismatchConsentError < Error
    def code
      'C003'
    end
  end

  class ExpiredConsentError < Error
    def code
      'C004'
    end
  end

  class MaximumNumberOfCallsReachedConsentError < Error
    def code
      'C005'
    end
  end

  class GenericTransactionError < Error
    def code
      'T000'
    end
  end

  class InvalidConsentForProductError < Error
    def code
      'T001'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
afterbanks-psd2-api-ruby-0.1.1 lib/afterbanks_psd2/error.rb
afterbanks-psd2-api-ruby-0.1.0 lib/afterbanks_psd2/error.rb