We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ba1cd2 commit 2ea65fcCopy full SHA for 2ea65fc
1 file changed
apps/backend/src/modules/semantic-search/client.ts
@@ -41,10 +41,17 @@ export async function searchSemantic(
41
if (!response.ok) {
42
let detail: string | undefined;
43
try {
44
- const body = await response.json();
+ const body = (await response.json()) as {
45
+ detail?: string;
46
+ error?: string;
47
+ };
48
detail = body?.detail ?? body?.error;
- } catch {}
- throw new Error(detail ?? `Semantic search service error: ${response.statusText}`);
49
+ } catch {
50
+ /* ignore parse errors */
51
+ }
52
+ throw new Error(
53
+ detail ?? `Semantic search service error: ${response.statusText}`
54
+ );
55
}
56
57
return (await response.json()) as SemanticSearchResponse;
0 commit comments