Exception: Puppet::ParseErrorWithIssue
- Inherits:
-
ParseError
- Object
- RuntimeError
- Error
- ParseError
- Puppet::ParseErrorWithIssue
- Defined in:
- lib/puppet/error.rb
Overview
Contains an issue code and can be annotated with an environment and a node
Direct Known Subclasses
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#basic_message ⇒ Object
readonly
Returns the value of attribute basic_message.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#issue_code ⇒ Object
readonly
Returns the value of attribute issue_code.
-
#node ⇒ Object
Returns the value of attribute node.
Attributes included from ExternalFileError
Attributes inherited from Error
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, file = nil, line = nil, pos = nil, original = nil, issue_code = nil, arguments = nil) ⇒ ParseErrorWithIssue
constructor
A new instance of ParseErrorWithIssue.
- #to_s ⇒ Object
Constructor Details
#initialize(message, file = nil, line = nil, pos = nil, original = nil, issue_code = nil, arguments = nil) ⇒ ParseErrorWithIssue
Returns a new instance of ParseErrorWithIssue.
60 61 62 63 64 65 |
# File 'lib/puppet/error.rb', line 60 def initialize(, file=nil, line=nil, pos=nil, original=nil, issue_code= nil, arguments = nil) super(, file, line, pos, original) @issue_code = issue_code @basic_message = @arguments = arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
49 50 51 |
# File 'lib/puppet/error.rb', line 49 def arguments @arguments end |
#basic_message ⇒ Object (readonly)
Returns the value of attribute basic_message.
49 50 51 |
# File 'lib/puppet/error.rb', line 49 def @basic_message end |
#environment ⇒ Object
Returns the value of attribute environment.
50 51 52 |
# File 'lib/puppet/error.rb', line 50 def environment @environment end |
#issue_code ⇒ Object (readonly)
Returns the value of attribute issue_code.
49 50 51 |
# File 'lib/puppet/error.rb', line 49 def issue_code @issue_code end |
#node ⇒ Object
Returns the value of attribute node.
50 51 52 |
# File 'lib/puppet/error.rb', line 50 def node @node end |
Class Method Details
.from_issue_and_stack(issue, args = {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/puppet/error.rb', line 74 def self.from_issue_and_stack(issue, args = {}) filename, line = Puppet::Pops::PuppetStack.top_of_stack self.new( issue.format(args), filename, line, nil, nil, issue.issue_code, args) end |
Instance Method Details
#to_s ⇒ Object
67 68 69 70 71 72 |
# File 'lib/puppet/error.rb', line 67 def to_s msg = super msg = _("Could not parse for environment %{environment}: %{message}") % { environment: environment, message: msg } if environment msg = _("%{message} on node %{node}") % { message: msg, node: node } if node msg end |