fix: expose serper response code

This commit is contained in:
yanlong.wang 2025-03-11 12:07:47 +08:00
parent 8df4df5b0a
commit 662fa9819e
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -15,6 +15,10 @@ export async function serperSearch(query: string): Promise<{ response: SerperSea
timeout: 10000
});
if (response.status !== 200) {
throw new Error(`Serper search failed: ${response.status} ${response.statusText}`)
}
// Maintain the same return structure as the original code
return { response: response.data };
}