From 77ee9bea38587d53552772eca3466f33837f425b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Fri, 18 Oct 2024 10:13:01 +0100 Subject: [PATCH] smp protocol: add STORE error (#1372) --- src/Simplex/Messaging/Protocol.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Simplex/Messaging/Protocol.hs b/src/Simplex/Messaging/Protocol.hs index bdc0254b4..3c5ba11cb 100644 --- a/src/Simplex/Messaging/Protocol.hs +++ b/src/Simplex/Messaging/Protocol.hs @@ -1198,6 +1198,8 @@ data ErrorType CRYPTO | -- | SMP queue capacity is exceeded on the server QUOTA + | -- | SMP server storage error + STORE {storeErr :: String} | -- | ACK command is sent without message to be acknowledged NO_MSG | -- | sent message is too large (> maxMessageLength = 16088 bytes) @@ -1513,6 +1515,7 @@ instance Encoding ErrorType where AUTH -> "AUTH" CRYPTO -> "CRYPTO" QUOTA -> "QUOTA" + STORE err -> "STORE " <> smpEncode err EXPIRED -> "EXPIRED" NO_MSG -> "NO_MSG" LARGE_MSG -> "LARGE_MSG" @@ -1528,6 +1531,7 @@ instance Encoding ErrorType where "AUTH" -> pure AUTH "CRYPTO" -> pure CRYPTO "QUOTA" -> pure QUOTA + "STORE" -> STORE <$> _smpP "EXPIRED" -> pure EXPIRED "NO_MSG" -> pure NO_MSG "LARGE_MSG" -> pure LARGE_MSG