lib/aws/cfn/compiler/mixins/parse.rb in aws-cfn-compiler-0.8.6 vs lib/aws/cfn/compiler/mixins/parse.rb in aws-cfn-compiler-0.8.7

- old
+ new

@@ -88,11 +88,14 @@ template: @dsl, logger: @logger, compiler: self } source_file = File.expand_path(filename) - # source = IO.read(source_file) - eval "require source_file", binding + begin + eval 'require source_file', binding + rescue Exception => e + abort! "Cannot compile #{source_file}\n\n" + e.message + "\n\n" + e.backtrace.to_s + end unless @dsl.dict[section.to_sym] abort! "Unable to compile/expand #{filename} for #{section}/#{base}" end sym_to_s(@dsl.dict[section.to_sym]) end