fix(google): guard veo rest polling · openclaw/openclaw@a0c70c4
steipete
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -289,18 +289,25 @@ async function requestGoogleVideoJson(params: {
|
289 | 289 | }), |
290 | 290 | ); |
291 | 291 | try { |
292 | | -const response = await fetch(params.url, { |
293 | | -method: params.method, |
294 | | -headers: params.headers, |
295 | | - ...(params.body === undefined ? {} : { body: JSON.stringify(params.body) }), |
| 292 | +const { response, release } = await fetchWithSsrFGuard({ |
| 293 | +url: params.url, |
| 294 | +init: { |
| 295 | +method: params.method, |
| 296 | +headers: params.headers, |
| 297 | + ...(params.body === undefined ? {} : { body: JSON.stringify(params.body) }), |
| 298 | +}, |
296 | 299 | signal: controller.signal, |
297 | 300 | }); |
298 | | -const text = await response.text(); |
299 | | -const payload = text ? (JSON.parse(text) as unknown) : {}; |
300 | | -if (!response.ok) { |
301 | | -throw new Error(typeof payload === "string" ? payload : JSON.stringify(payload ?? null)); |
| 301 | +try { |
| 302 | +const text = await response.text(); |
| 303 | +const payload = text ? (JSON.parse(text) as unknown) : {}; |
| 304 | +if (!response.ok) { |
| 305 | +throw new Error(typeof payload === "string" ? payload : JSON.stringify(payload ?? null)); |
| 306 | +} |
| 307 | +return payload; |
| 308 | +} finally { |
| 309 | +await release(); |
302 | 310 | } |
303 | | -return payload; |
304 | 311 | } finally { |
305 | 312 | clearTimeout(timeout); |
306 | 313 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。