Module: CfnDsl::Errors

Defined in:
lib/cfndsl/Errors.rb

Constant Summary collapse

@@errors =
[]

Class Method Summary collapse

Class Method Details

.clearObject



19
20
21
# File 'lib/cfndsl/Errors.rb', line 19

def self.clear()
  @@errors = []
end

.error(err, idx = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cfndsl/Errors.rb', line 5

def self.error( err, idx=nil )
  if(idx.nil?) then
    @@errors.push ( err + "\n" + caller.join("\n") + "\n" )
  else
    if( m = caller[idx].match(/^.*?:\d+:/ ) ) then
      err_loc = m[0];
    else
      err_loc = caller[idx]
    end

    @@errors.push ( err_loc + " " + err + "\n" )
  end
end

.errorsObject



23
24
25
# File 'lib/cfndsl/Errors.rb', line 23

def self.errors()
  @@errors
end

.errors?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/cfndsl/Errors.rb', line 27

def self.errors?()
  return @@errors.length > 0
end