lib/awestruct/handlers/front_matter_handler.rb in awestruct-0.5.4.rc vs lib/awestruct/handlers/front_matter_handler.rb in awestruct-0.5.4.rc2

- old
+ new

@@ -1,5 +1,6 @@ +require 'awestruct/util/exception_helper' require 'awestruct/handlers/base_handler' require 'yaml' module Awestruct @@ -82,12 +83,12 @@ @raw_content = nil @content_line_offset = -1 end begin - @front_matter = yaml_content.empty? ? {} : (YAML.load yaml_content) + @front_matter = yaml_content.empty? ? {} : (YAML.load(yaml_content) || {}) rescue => e - $LOG.error "could not parse #{relative_source_path}" if $LOG.error? + ExceptionHelper.log_message "could not parse #{relative_source_path}" raise e end @parsed_parts = true