Skip to content

Commit d3fa366

Browse files
Simplify throw condition AI binding (#3659)
1 parent 4e753b6 commit d3fa366

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/cloudflare/internal/ai-api.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,7 @@ export class Ai {
175175
return res;
176176
}
177177

178-
if (!res.ok) {
179-
throw await this._parseError(res);
180-
}
181-
182-
if (!res.body) {
178+
if (!res.ok || !res.body) {
183179
throw await this._parseError(res);
184180
}
185181

0 commit comments

Comments
 (0)