Skip to content

Commit d08dd2b

Browse files
committed
Add From<BoxError> for tonic::transport::Error
1 parent 688522a commit d08dd2b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tonic/src/transport/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::BoxError;
12
use std::{error::Error as StdError, fmt};
23

34
type Source = Box<dyn StdError + Send + Sync + 'static>;
@@ -90,3 +91,9 @@ impl StdError for Error {
9091
.map(|source| &**source as &(dyn StdError + 'static))
9192
}
9293
}
94+
95+
impl From<BoxError> for Error {
96+
fn from(value: BoxError) -> Self {
97+
Self::from_source(value)
98+
}
99+
}

0 commit comments

Comments
 (0)