File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ pub enum ReplyableError {
7272/// "message": "Human readable error message"
7373/// }
7474/// ```
75+ #[ derive( Debug , Clone , PartialEq , Eq ) ]
7576pub struct JsonReply {
7677 /// The error code
7778 error_code : ErrorCode ,
Original file line number Diff line number Diff line change @@ -305,7 +305,17 @@ impl ResponseError {
305305 }
306306}
307307
308- impl std:: error:: Error for ResponseError { }
308+ impl std:: error:: Error for ResponseError {
309+ fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
310+ use ResponseError :: * ;
311+
312+ match self {
313+ WellKnown ( error) => Some ( error) ,
314+ Validation ( error) => Some ( error) ,
315+ Unrecognized { .. } => None ,
316+ }
317+ }
318+ }
309319
310320impl From < WellKnownError > for ResponseError {
311321 fn from ( value : WellKnownError ) -> Self { Self :: WellKnown ( value) }
@@ -376,6 +386,8 @@ impl WellKnownError {
376386 }
377387}
378388
389+ impl std:: error:: Error for WellKnownError { }
390+
379391impl core:: fmt:: Display for WellKnownError {
380392 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
381393 match self . code {
You can’t perform that action at this time.
0 commit comments