diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2021-02-03 11:40:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-03 11:40:43 +0100 |
commit | fb358380c0570103619b0ce71c7fcb1b5a17986c (patch) | |
tree | 353e1edc93240b57c29440f370372a67a4ff9cb6 /op_crates | |
parent | 3f6483e5015c4cc3d1569b85ea198bdc1cb41082 (diff) |
fix: improve http client builder error message (#9380)
Include the lower-level error message in the generic error message.
No test because I can't actually make it fail by passing it bad PEM.
I checked and `reqwest::Certificate::from_pem()` always returns `Ok()`.
Fixes #9364.
Diffstat (limited to 'op_crates')
-rw-r--r-- | op_crates/fetch/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/op_crates/fetch/lib.rs b/op_crates/fetch/lib.rs index 46c72e7a8..23f356a96 100644 --- a/op_crates/fetch/lib.rs +++ b/op_crates/fetch/lib.rs @@ -3,6 +3,7 @@ #![deny(warnings)] use deno_core::error::bad_resource_id; +use deno_core::error::generic_error; use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::futures::Future; @@ -433,5 +434,5 @@ fn create_http_client( } builder .build() - .map_err(|_| deno_core::error::generic_error("Unable to build http client")) + .map_err(|e| generic_error(format!("Unable to build http client: {}", e))) } |