Skip to content

Commit 3585bd2

Browse files
LeandroVandariLeandro Vandari
andauthored
Implement std::error::Error for TemporalError (#664)
Currently, `TemporalError` does not implement `std::error::Error`, which makes `TemporalResult` incompatible with ecosystem crates for error conversions, such as `anyhow`. The fix is a simple one-line addition to implement the error trait, since `TemporalError` already implements `Display` and `Debug`. --------- Co-authored-by: Leandro Vandari <leandrovandari@gmail.com>
1 parent 43c0c00 commit 3585bd2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ impl TemporalError {
135135
}
136136
}
137137

138+
impl core::error::Error for TemporalError {}
139+
138140
impl fmt::Display for TemporalError {
139141
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140142
write!(f, "{}", self.kind)?;

0 commit comments

Comments
 (0)