From 4a0b2173d4dcf8621f1d34c1b1addc52f4a2b2ce Mon Sep 17 00:00:00 2001 From: Julius de Bruijn Date: Tue, 15 Aug 2023 20:27:09 +0200 Subject: [PATCH] Handle command errors --- src/error.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/error.rs b/src/error.rs index f4219fb..70c97b5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -35,6 +35,11 @@ impl From for Error { Self::BadRequest(value) } + ErrorKind::Command(error) => { + let value = json!({ "error": error.message, "error_code": "InvalidArgument", "link": "string" }); + + Self::BadRequest(value) + } ErrorKind::Authentication { message, .. } => { let value = json!({ "error": message, "error_code": "InvalidSession", "link": "string" });