File tree Expand file tree Collapse file tree
src/vectorcode/subcommands/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import json
22import logging
33import os
4- import sys
54
65from chromadb import GetResult
76from chromadb .api .models .AsyncCollection import AsyncCollection
@@ -127,7 +126,7 @@ async def build_query_results(
127126 )
128127
129128 structured_result .append (full_result )
130- else :
129+ else : # pragma: nocover
131130 logger .error (
132131 "This collection doesn't support chunk-mode output because it lacks the necessary metadata. Please re-vectorise it." ,
133132 )
@@ -154,21 +153,17 @@ async def query(configs: Config) -> int:
154153 if not verify_ef (collection , configs ):
155154 return 1
156155 except (ValueError , InvalidCollectionException ):
157- print (
156+ logger . error (
158157 f"There's no existing collection for { configs .project_root } " ,
159- file = sys .stderr ,
160158 )
161159 return 1
162160 except InvalidDimensionException :
163- print (
161+ logger . error (
164162 "The collection was embedded with a different embedding model." ,
165- file = sys .stderr ,
166163 )
167164 return 1
168- except IndexError :
169- print (
170- "Failed to get the collection. Please check your config." , file = sys .stderr
171- )
165+ except IndexError : # pragma: nocover
166+ logger .error ("Failed to get the collection. Please check your config." )
172167 return 1
173168
174169 if not configs .pipe :
You can’t perform that action at this time.
0 commit comments