lib/manifold/services/vector_service.rb in manifold-cli-0.0.7 vs lib/manifold/services/vector_service.rb in manifold-cli-0.0.8

- old
+ new

@@ -8,17 +8,16 @@ @logger = logger end def load_vector_schema(vector_name) path = config_path(vector_name) - unless path.file? - @logger.error("Vector configuration not found: #{path}") - return nil - end - config = YAML.safe_load_file(path) fields = transform_attributes_to_schema(config["attributes"]) { "name" => vector_name.downcase, "type" => "RECORD", "fields" => fields } + rescue Errno::ENOENT, Errno::EISDIR + raise "Vector configuration not found: #{path}" + rescue Psych::Exception => e + raise "Invalid YAML in vector configuration #{path}: #{e.message}" end private def transform_attributes_to_schema(attributes)