summaryrefslogtreecommitdiff
path: root/runtime/errors.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2021-10-04 18:50:40 -0700
committerBert Belder <bertbelder@gmail.com>2021-11-08 12:49:11 -0800
commit5b1e537446454f6332de44adbeb6a15ff072c2fa (patch)
tree6d5af90855d7f60cbb817fd7b15ff2591a96d18d /runtime/errors.rs
parentf1b1a3f389827af8983a78680c066fdad337ae32 (diff)
refactor(ext/http): rewrite hyper integration and fix bug (#12332)
Fixes: #12193
Diffstat (limited to 'runtime/errors.rs')
-rw-r--r--runtime/errors.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/errors.rs b/runtime/errors.rs
index fe6e71193..1491161d3 100644
--- a/runtime/errors.rs
+++ b/runtime/errors.rs
@@ -17,6 +17,7 @@ use deno_fetch::reqwest;
use std::env;
use std::error::Error;
use std::io;
+use std::sync::Arc;
fn get_dlopen_error_class(error: &dlopen::Error) -> &'static str {
use dlopen::Error::*;
@@ -164,6 +165,10 @@ pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> {
})
.or_else(|| e.downcast_ref::<hyper::Error>().map(get_hyper_error_class))
.or_else(|| {
+ e.downcast_ref::<Arc<hyper::Error>>()
+ .map(|e| get_hyper_error_class(&**e))
+ })
+ .or_else(|| {
e.downcast_ref::<deno_core::Canceled>().map(|e| {
let io_err: io::Error = e.to_owned().into();
get_io_error_class(&io_err)