Sha256: c67effa5b53eecdf352420b23882444c7fe343ea94ac624070e6278f50dd727e

Contents?: true

Size: 684 Bytes

Versions: 6

Compression:

Stored size: 684 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")
      end

      class ParameterNotFoundError < NugrantVagrantError
        error_key(:parameter_not_found)

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nugrant-2.0.0.pre1 lib/nugrant/vagrant/errors.rb
nugrant-1.4.2 lib/nugrant/vagrant/errors.rb
nugrant-1.4.1 lib/nugrant/vagrant/errors.rb
nugrant-1.4.0 lib/nugrant/vagrant/errors.rb
nugrant-1.3.0 lib/nugrant/vagrant/errors.rb
nugrant-1.2.0 lib/nugrant/vagrant/errors.rb