Sha256: ecf3c1e54829569d95c598903ac70fefe47c403f10fb4347ac40dc0673b721e4

Contents?: true

Size: 841 Bytes

Versions: 8

Compression:

Stored size: 841 Bytes

Contents

require 'vagrant/errors'

module Berkshelf
  # @author Jamie Winsor <reset@riotgames.com>
  #
  # A wrapper for a BerkshelfError for Vagrant. All Berkshelf exceptions should be
  # wrapped in this proxy object so they are properly handled when Vagrant encounters
  # an exception.
  #
  # @example wrapping an error encountered within the Vagrant plugin
  #   rescue BerkshelfError => e
  #     VagrantWrapperError.new(e)
  #   end
  class VagrantWrapperError < ::Vagrant::Errors::VagrantError
    # @param [BerkshelfError]
    attr_reader :original

    # @param [BerkshelfError] original
    def initialize(original)
      @original = original
    end

    def to_s
      "#{original.class}: #{original.to_s}"
    end

    private

      def method_missing(fun, *args, &block)
        original.send(fun, *args, &block)
      end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrant-berkshelf-1.3.2 lib/berkshelf/vagrant/errors.rb
vagrant-berkshelf-1.2.0 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.1.2 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.1.0 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.0.6 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.0.4 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.0.3 lib/berkshelf/vagrant/errors.rb
berkshelf-vagrant-1.0.0.rc1 lib/berkshelf/vagrant/errors.rb