Exception: Puppet::Pops::SemanticError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/puppet/pops/semantic_error.rb

Overview

Error that is used to raise an Issue. See Issues.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(issue, semantic = nil, options = {}) ⇒ SemanticError

Returns a new instance of SemanticError.

Parameters:

  • issue (Puppet::Pops::Issues::Issue) —

    the issue describing the severity and message

  • semantic (Puppet::Pops::Model::Locatable, nil) (defaults to: nil) —

    the expression causing the failure, or nil if unknown

  • options (Hash) (defaults to: {}) —

    an options hash with Symbol to value mapping - these are the arguments to the issue



13
14
15
16
17
# File 'lib/puppet/pops/semantic_error.rb', line 13

def initialize(issue, semantic=nil, options = {})
  @issue = issue
  @semantic = semantic
  @options = options
end

Instance Attribute Details

#issue ⇒ Object

Returns the value of attribute issue.



5
6
7
# File 'lib/puppet/pops/semantic_error.rb', line 5

def issue
  @issue
end

#options ⇒ Object

Returns the value of attribute options.



7
8
9
# File 'lib/puppet/pops/semantic_error.rb', line 7

def options
  @options
end

#semantic ⇒ Object

Returns the value of attribute semantic.



6
7
8
# File 'lib/puppet/pops/semantic_error.rb', line 6

def semantic
  @semantic
end

Instance Method Details

#file ⇒ Object



19
20
21
# File 'lib/puppet/pops/semantic_error.rb', line 19

def file
  @options[:file]
end

#line ⇒ Object



23
24
25
# File 'lib/puppet/pops/semantic_error.rb', line 23

def line
  @options[:line]
end

#pos ⇒ Object



27
28
29
# File 'lib/puppet/pops/semantic_error.rb', line 27

def pos
  @options[:pos]
end