From d47b17d37df8590e4fc2abc249ee33e3ce612251 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Wed, 12 Oct 2022 09:23:33 +0200 Subject: fix(ext/fetch): throw TypeError on read failure (#16219) --- ext/fetch/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/fetch/lib.rs') diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index b8f784284..c141c3065 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -509,7 +509,7 @@ impl Resource for FetchResponseBodyResource { // safely call `await` on it without creating a race condition. Some(_) => match reader.as_mut().next().await.unwrap() { Ok(chunk) => assert!(chunk.is_empty()), - Err(err) => break Err(AnyError::from(err)), + Err(err) => break Err(type_error(err.to_string())), }, None => break Ok(BufView::empty()), } -- cgit v1.2.3