Sha256: a9b0bff65b0ac7e4ff79d479b4d47bc4f09aab28159c9e2049187ff1fca29338

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

module LedgerSync
  class ResourceError < Error
    attr_reader :resource

    def initialize(message:, resource:)
      @resource = resource
      super(message: message)
    end

    class MissingResourceError < self
      attr_reader :resource_type, :resource_external_id

      def initialize(message:, resource_type:, resource_external_id:)
        @resource_type = resource_type
        @resource_external_id = resource_external_id
        super(message: message, resource: nil)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ledger_sync-1.0.10 lib/ledger_sync/error/resource_errors.rb
ledger_sync-1.0.9 lib/ledger_sync/error/resource_errors.rb
ledger_sync-1.0.3 lib/ledger_sync/error/resource_errors.rb
ledger_sync-1.0.2 lib/ledger_sync/error/resource_errors.rb
ledger_sync-1.0.0 lib/ledger_sync/error/resource_errors.rb