diff --git a/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs b/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs index d36e5e3e1..03e9a6ab6 100644 --- a/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs +++ b/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs @@ -138,7 +138,10 @@ async fn main() -> Result<(), Box> { ] { // The SDK poller is used only by this smoke example. It is not part // of the platform-tripo public API. - sdk_client + // + // 每个端点单独报错并继续:这个示例的目的是一次跑完三个端点, + // 某个端点超时 / 传输失败不应把剩下的端点一起跳过。 + if let Err(error) = sdk_client .wait_for_task( &handle.task_id, WaitOptions { @@ -149,9 +152,19 @@ async fn main() -> Result<(), Box> { ..WaitOptions::default() }, ) - .await?; + .await + { + eprintln!("{name} skipped: wait failed: {error}"); + continue; + } - let snapshot = client.get_task(&handle).await?; + let snapshot = match client.get_task(&handle).await { + Ok(snapshot) => snapshot, + Err(error) => { + eprintln!("{name} skipped: task lookup failed: {error}"); + continue; + } + }; println!( "{name} status={:?} progress={:?} output={:?}", snapshot.status, snapshot.progress, snapshot.output @@ -165,7 +178,13 @@ async fn main() -> Result<(), Box> { continue; } - let downloaded = client.download_model(&snapshot).await?; + let downloaded = match client.download_model(&snapshot).await { + Ok(downloaded) => downloaded, + Err(error) => { + eprintln!("{name} skipped: artifact download failed: {error}"); + continue; + } + }; let filename = downloaded.filename(name); let mut file = File::create(&filename).await?; let mut bytes = 0u64;