# parse json
begin
hash = JSON.parse(buffer.string, :object_class => Hash, :array_class => Array) || {}
- rescue SyntaxError => exc
+ rescue SyntaxError, JSON::ParserError => exc
log 0, :error, 'in file "%s":' % filename
log 0, exc.to_s, :indent => 1
return nil
def assert_config!(conf_path)
value = nil
- #begin
+ begin
value = manager.instance_eval(conf_path)
#rescue NoMethodError
#rescue NameError
- #end
- assert! !value.nil? && value != "REQUIRED" do
- log :missing, "required configuration value for #{conf_path}"
+ ensure
+ assert! !value.nil? && value != "REQUIRED" do
+ log :missing, "required configuration value for #{conf_path}"
+ end
end
end