Module: CfnDsl::Errors
- Defined in:
- lib/cfndsl/errors.rb
Overview
Keeps track of errors
Class Method Summary collapse
Class Method Details
.clear ⇒ Object
19 20 21 |
# File 'lib/cfndsl/errors.rb', line 19 def self.clear @errors = [] end |
.error(err, idx = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cfndsl/errors.rb', line 8 def self.error(err, idx = nil) if idx.nil? @errors.push(err + "\n" + caller.join("\n") + "\n") else m = caller(idx..idx).first.match(/^.*?:\d+:/) err_loc = m ? m[0] : caller(idx..idx).first @errors.push(err_loc + ' ' + err + "\n") end end |
.errors ⇒ Object
23 24 25 |
# File 'lib/cfndsl/errors.rb', line 23 def self.errors @errors end |
.errors? ⇒ Boolean
27 28 29 |
# File 'lib/cfndsl/errors.rb', line 27 def self.errors? !@errors.empty? end |