diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-04-09 00:34:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 18:34:15 -0400 |
commit | 70af8128767f2fc5a9c59107d3b5ddc00531db55 (patch) | |
tree | 48513959f16273eab2c4b743d61042b00a72deb8 /runtime/errors.rs | |
parent | b30ac9c5cf58c34ed71d2f470cdbcd86a6096987 (diff) |
feat: native HTTP bindings (#9935)
Co-authered-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authered-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authered-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'runtime/errors.rs')
-rw-r--r-- | runtime/errors.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/errors.rs b/runtime/errors.rs index a8152b075..7bb109fb9 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -131,6 +131,10 @@ fn get_url_parse_error_class(_error: &url::ParseError) -> &'static str { "URIError" } +fn get_hyper_error_class(_error: &hyper::Error) -> &'static str { + "Http" +} + #[cfg(unix)] fn get_nix_error_class(error: &nix::Error) -> &'static str { use nix::errno::Errno::*; @@ -156,6 +160,7 @@ pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> { e.downcast_ref::<dlopen::Error>() .map(get_dlopen_error_class) }) + .or_else(|| e.downcast_ref::<hyper::Error>().map(get_hyper_error_class)) .or_else(|| { e.downcast_ref::<deno_core::Canceled>().map(|e| { let io_err: io::Error = e.to_owned().into(); |