Merge pull request #1024 from wangyanfu2/fix-TavilySearch-response

fix: add HTTP status code check in BraveSearchProvider
This commit is contained in:
Mauro
2026-03-03 11:42:05 +01:00
committed by GitHub
+4
View File
@@ -109,6 +109,10 @@ func (p *BraveSearchProvider) Search(ctx context.Context, query string, count in
return "", fmt.Errorf("failed to read response: %w", err)
}
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("brave api error (status %d): %s", resp.StatusCode, string(body))
}
var searchResp struct {
Web struct {
Results []struct {