diff --git a/ngrok/src/internals/proto.rs b/ngrok/src/internals/proto.rs index 04a1b77..4f2e6e1 100644 --- a/ngrok/src/internals/proto.rs +++ b/ngrok/src/internals/proto.rs @@ -9,6 +9,7 @@ use std::{ }, str::FromStr, string::FromUtf8Error, + sync::Arc, }; use muxado::typed::StreamType; @@ -54,6 +55,42 @@ pub trait Error: error::Error { } } +impl Error for Box +where + E: Error, +{ + fn error_code(&self) -> Option<&str> { + ::error_code(self) + } + fn msg(&self) -> String { + ::msg(self) + } +} + +impl Error for Arc +where + E: Error, +{ + fn error_code(&self) -> Option<&str> { + ::error_code(self) + } + fn msg(&self) -> String { + ::msg(self) + } +} + +impl<'a, E> Error for &'a E +where + E: Error, +{ + fn error_code(&self) -> Option<&str> { + ::error_code(self) + } + fn msg(&self) -> String { + ::msg(self) + } +} + #[derive(Serialize, Deserialize, Debug, Clone, Default)] pub struct ErrResp { pub msg: String,