Sha256: 3fbd2255977f4c4f882638e96ff58be31d470ee4e73804dfb626d20fb6a41a46

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 Bytes

Contents

require 'vagrant/errors'

require 'nugrant/helper/stack'

module Nugrant
  module Vagrant
    module Errors
      class NugrantVagrantError < ::Vagrant::Errors::VagrantError
        error_namespace("nugrant.vagrant.errors")

        def compute_context()
          Helper::Stack.fetch_error_region(caller(), {
            :matcher => /(.+Vagrantfile):([0-9]+)/
          })
        end
      end

      class ParameterNotFoundError < NugrantVagrantError
        error_key(:parameter_not_found)

        def initialize(options = nil, *args)
          super({:context => compute_context()}.merge(options || {}), *args)
        end
      end

      class VagrantUserParseError < NugrantVagrantError
        error_key(:parse_error)

        def initialize(options = nil, *args)
          super(options, *args)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nugrant-2.1.3 lib/nugrant/vagrant/errors.rb
nugrant-2.1.2 lib/nugrant/vagrant/errors.rb
nugrant-2.1.1 lib/nugrant/vagrant/errors.rb
nugrant-2.1.0 lib/nugrant/vagrant/errors.rb
nugrant-2.0.2 lib/nugrant/vagrant/errors.rb
nugrant-2.0.1 lib/nugrant/vagrant/errors.rb
nugrant-2.0.0 lib/nugrant/vagrant/errors.rb
nugrant-2.0.0.rc1 lib/nugrant/vagrant/errors.rb
nugrant-2.0.0.pre2 lib/nugrant/vagrant/errors.rb