From eca83fc9b45ab1e5a73bd7b13b05ee42ab1a4dcc Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Thu, 17 Oct 2024 12:05:38 -0700 Subject: refactor(ext/web): use concrete error types (#26185) --- runtime/ops/web_worker.rs | 1 + runtime/ops/web_worker/sync_fetch.rs | 2 +- runtime/ops/worker_host.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/ops') diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index 0ed76ebd5..e28bf2192 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -50,6 +50,7 @@ async fn op_worker_recv_message( .recv(state.clone()) .or_cancel(handle.cancel) .await? + .map_err(|e| e.into()) } #[op2(fast)] diff --git a/runtime/ops/web_worker/sync_fetch.rs b/runtime/ops/web_worker/sync_fetch.rs index cdb151a86..87fc55840 100644 --- a/runtime/ops/web_worker/sync_fetch.rs +++ b/runtime/ops/web_worker/sync_fetch.rs @@ -134,7 +134,7 @@ pub fn op_worker_sync_fetch( let mime_type = mime_type_essence(&blob.media_type); - let body = blob.read_all().await?; + let body = blob.read_all().await; (Bytes::from(body), Some(mime_type), script) } diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index 61e5ef3e0..d85541d51 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -359,7 +359,7 @@ async fn op_host_recv_message( } Ok(ret) } - Ok(Err(err)) => Err(err), + Ok(Err(err)) => Err(err.into()), Err(_) => { // The worker was terminated. Ok(None) -- cgit v1.2.3