We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1f2db9f + 280cfc6 commit 7052392Copy full SHA for 7052392
iroh/src/protocol.rs
@@ -123,12 +123,21 @@ pub enum AcceptError {
123
124
impl AcceptError {
125
/// Creates a new user error from an arbitrary error type.
126
+ // TODO(Frando): Rename to `from_std`
127
#[track_caller]
128
pub fn from_err<T: std::error::Error + Send + Sync + 'static>(value: T) -> Self {
129
e!(AcceptError::User {
130
source: AnyError::from_std(value)
131
})
132
}
133
+
134
+ /// Creates a new user error from an arbitrary boxed error.
135
+ #[track_caller]
136
+ pub fn from_boxed(value: Box<dyn std::error::Error + Send + Sync>) -> Self {
137
+ e!(AcceptError::User {
138
+ source: AnyError::from_std_box(value)
139
+ })
140
+ }
141
142
143
impl From<std::io::Error> for AcceptError {
0 commit comments