def header_to_json(header)
      @log.info "[In header: #{header} "
      header = MultiJson.load(header, :symbolize_keys => true)

      if header[:error]
        # Raise this as a Ruby exception of the MentosError class.
        # Stop so we don't leave the pipe in an inconsistent state.
        @log.error "Failed to convert header to JSON."
        stop header[:error]
        raise MentosError, header[:error]
      else
        header
      end
    end
def header_to_json(header)
      @log.info "[In header: #{header} "
      header = MultiJson.load(header, :symbolize_keys => true)

      if header[:error]
        # Raise this as a Ruby exception of the MentosError class.
        # Stop so we don't leave the pipe in an inconsistent state.
        @log.error "Failed to convert header to JSON."
        stop header[:error]
        raise MentosError, header[:error]
      else
        header
      end
    end
Convert a text header into JSON for easy access.