Sha256: fdc620538cc31dbfe1862ef99cd22f14064c8e2ac6cd825e5945c039b8d962c5

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true

module Paquito
  class TranslateErrors
    def initialize(coder)
      @coder = Paquito.cast(coder)
    end

    def dump(object)
      @coder.dump(object)
    rescue Paquito::Error
      raise
    rescue => error
      raise PackError, error.message
    end

    def load(payload)
      @coder.load(payload)
    rescue Paquito::Error
      raise
    rescue => error
      raise UnpackError, error.message
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
paquito-0.11.2 lib/paquito/translate_errors.rb
paquito-0.11.1 lib/paquito/translate_errors.rb
paquito-0.11.0 lib/paquito/translate_errors.rb
paquito-0.10.0 lib/paquito/translate_errors.rb
paquito-0.9.2 lib/paquito/translate_errors.rb