Skip to content

Commit

Permalink
Make Error StdError-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier authored and oroulet committed Jan 8, 2025
1 parent 7a39591 commit 7efff22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions opcua-types/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ impl Display for Error {
}
}

impl StdError for Error {
fn source(&self) -> Option<&(dyn StdError + 'static)> {
Some(&*self.context)
}
}

impl Error {
/// Create a new error with the specified `status` code and
/// `context` as a dynamic error source.
Expand Down

0 comments on commit 7efff22

Please sign in to comment.