From 7efff22bbfd80e15286db9a62ca13445e4aac427 Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 8 Jan 2025 07:21:57 +0100 Subject: [PATCH] Make Error StdError-compatible --- opcua-types/src/encoding.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opcua-types/src/encoding.rs b/opcua-types/src/encoding.rs index 7bdd5acb..f81f9089 100644 --- a/opcua-types/src/encoding.rs +++ b/opcua-types/src/encoding.rs @@ -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.