Skip to content

Commit d7fcdf1

Browse files
committed
fix(rs-wit-bindgen): do not fail on async I/O errors
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent bea73e2 commit d7fcdf1

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ wasmtime = { version = "22", default-features = false }
127127
wasmtime-wasi = { version = "22", default-features = false }
128128
wit-bindgen = { version = "0.27", default-features = false }
129129
wit-bindgen-core = { version = "0.27", default-features = false }
130-
wit-bindgen-wrpc = { version = "0.4", default-features = false, path = "./crates/wit-bindgen" }
130+
wit-bindgen-wrpc = { version = "0.4.1", default-features = false, path = "./crates/wit-bindgen" }
131131
wit-bindgen-wrpc-go = { version = "0.2", default-features = false, path = "./crates/wit-bindgen-go" }
132-
wit-bindgen-wrpc-rust = { version = "0.4", default-features = false, path = "./crates/wit-bindgen-rust" }
132+
wit-bindgen-wrpc-rust = { version = "0.4.1", default-features = false, path = "./crates/wit-bindgen-rust" }
133133
wit-bindgen-wrpc-rust-macro = { version = "0.4", default-features = false, path = "./crates/wit-bindgen-rust-macro" }
134134
wit-component = { version = "0.212", default-features = false }
135135
wit-parser = { version = "0.212", default-features = false }

crates/wit-bindgen-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wit-bindgen-wrpc-rust"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = """
55
Rust bindings generator for wRPC, typically used through
66
the `wit-bindgen-wrpc` crate's `generate!` macro.

crates/wit-bindgen-rust/src/interface.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,30 +337,32 @@ pub async fn serve_interface<T: {wrpc_transport}::Serve, U>(
337337
self.src,
338338
r#"
339339
).await {{
340-
Ok(returns) => {{
340+
Ok(results) => {{
341341
match tx("#,
342342
);
343343
if func.results.len() == 1 {
344-
// wrap single-element returns into a tuple for correct indexing
345-
self.push_str("(returns,)");
344+
// wrap single-element results into a tuple for correct indexing
345+
self.push_str("(results,)");
346346
} else {
347-
self.push_str("returns");
347+
self.push_str("results");
348348
}
349349
uwrite!(
350350
self.src,
351351
r#"
352352
).await {{
353353
Ok(()) => {{
354354
if let Some(rx) = rx {{
355-
rx.await??;
355+
if let Err(err) = rx.await? {{
356+
{tracing}::warn!(?err, "failed to receive async `{instance}.{wit_name}` invocation parameters");
357+
}}
356358
}}
357359
continue;
358360
}}
359361
Err(err) => {{
360362
if let Some(rx) = rx {{
361363
rx.abort();
362364
}}
363-
{tracing}::warn!(?err, "failed to send returns");
365+
{tracing}::warn!(?err, "failed to transmit `{instance}.{wit_name}` invocation results");
364366
}}
365367
}}
366368
}},

crates/wit-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wit-bindgen-wrpc"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = """
55
Rust bindings generator for wRPC.
66
"""

0 commit comments

Comments
 (0)