Skip to content

Commit 7052392

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat-multipath
2 parents 1f2db9f + 280cfc6 commit 7052392

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

iroh/src/protocol.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,21 @@ pub enum AcceptError {
123123

124124
impl AcceptError {
125125
/// Creates a new user error from an arbitrary error type.
126+
// TODO(Frando): Rename to `from_std`
126127
#[track_caller]
127128
pub fn from_err<T: std::error::Error + Send + Sync + 'static>(value: T) -> Self {
128129
e!(AcceptError::User {
129130
source: AnyError::from_std(value)
130131
})
131132
}
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+
}
132141
}
133142

134143
impl From<std::io::Error> for AcceptError {

0 commit comments

Comments
 (0)