diff --git a/scripts/check-duplicates.js b/scripts/check-duplicates.js index cb6e5f82..26830b45 100644 --- a/scripts/check-duplicates.js +++ b/scripts/check-duplicates.js @@ -115,7 +115,8 @@ async function run() { }), } ); - const data = await response.json(); + if (!response.ok) throw new Error("Request failed"); +const data = await response.json(); if (data.error || !data.embedding || !data.embedding.values) { console.error("Embedding error:", data.error || "Invalid response"); diff --git a/scripts/validate-apis.js b/scripts/validate-apis.js index 0dc1b5d9..c13e925c 100644 --- a/scripts/validate-apis.js +++ b/scripts/validate-apis.js @@ -157,19 +157,4 @@ if (args.includes('--help') || args.includes('-h')) { switch (service) { case 'pinecone': validatePinecone().then(result => { - process.exit(result.success ? 0 : 1); - }); - break; - case 'github': - validateGitHub().then(result => { - process.exit(result.success ? 0 : 1); - }); - break; - case 'gemini': - validateGemini().then(result => { - process.exit(result.success ? 0 : 1); - }); - break; - default: - validateAllConnections(); -} \ No newline at end of file + .catch(err => console.error(err)) \ No newline at end of file