diff --git a/crates/core/src/chunking.rs b/crates/core/src/chunking.rs index f9752888a6..804d91bb91 100644 --- a/crates/core/src/chunking.rs +++ b/crates/core/src/chunking.rs @@ -23,7 +23,6 @@ use async_nats::jetstream::{ object_store::{Config, ObjectStore}, Context as JetstreamContext, }; -use futures::TryFutureExt; use tokio::io::{AsyncRead, AsyncReadExt}; use tracing::{debug, error, instrument}; @@ -73,16 +72,17 @@ impl ChunkEndpoint { .await .map_err(|e| anyhow!(e).context("failed to get object store"))?; debug!(invocation_id = %inv_id, "chunkify starting to receive"); - let mut obj = store.get(inv_id).await.map_err(|e| { - anyhow!(e).context("failed to receive chunked stream for inv {inv_id}: {e}") - })?; + let mut obj = store + .get(inv_id) + .await + .context("failed to receive chunked stream")?; obj.read_to_end(&mut result) - .map_err(|e| anyhow!(e).context("failed to read chunked stream for inv {inv_id}: {e}")) - .await?; + .await + .context("failed to read chunked stream")?; if let Err(e) = store.delete(inv_id).await { // not deleting will be a non-fatal error for the receiver, // if all the bytes have been received - error!(invocation_id = %inv_id, error = %e, "failed to delete chunks for inv"); + error!(invocation_id = %inv_id, error = %e, "failed to delete chunks"); } Ok(result) } diff --git a/crates/runtime/src/actor/module/wasmbus.rs b/crates/runtime/src/actor/module/wasmbus.rs index 2e4a682c1f..07ab14b262 100644 --- a/crates/runtime/src/actor/module/wasmbus.rs +++ b/crates/runtime/src/actor/module/wasmbus.rs @@ -147,8 +147,7 @@ fn write_bytes( } #[instrument(skip(store, err))] -fn set_host_error(store: &mut wasmtime::Caller<'_, super::Ctx>, err: impl ToString) { - let err = err.to_string(); +fn set_host_error(store: &mut wasmtime::Caller<'_, super::Ctx>, err: String) { trace!(err, "set host error"); store.data_mut().wasmbus.host_error = Some(err); } @@ -308,7 +307,7 @@ async fn host_call( Ok(wasm::SUCCESS) } Err(err) => { - set_host_error(&mut store, err); + set_host_error(&mut store, format!("{err:#}")); Ok(wasm::ERROR) } }