diff --git a/simplexmq.cabal b/simplexmq.cabal index 71e23b666..bc30717d6 100644 --- a/simplexmq.cabal +++ b/simplexmq.cabal @@ -1,7 +1,7 @@ cabal-version: 1.12 name: simplexmq -version: 6.4.5.1 +version: 6.4.5.2 synopsis: SimpleXMQ message broker description: This package includes <./docs/Simplex-Messaging-Server.html server>, <./docs/Simplex-Messaging-Client.html client> and diff --git a/src/Simplex/Messaging/Protocol.hs b/src/Simplex/Messaging/Protocol.hs index e5d918cc6..40314ad2a 100644 --- a/src/Simplex/Messaging/Protocol.hs +++ b/src/Simplex/Messaging/Protocol.hs @@ -2258,7 +2258,11 @@ $(J.deriveJSON defaultJSON ''MsgFlags) $(J.deriveJSON (sumTypeJSON id) ''CommandError) -$(J.deriveJSON (sumTypeJSON $ dropPrefix "NE") ''NetworkError) +$(J.deriveToJSON (sumTypeJSON $ dropPrefix "NE") ''NetworkError) + +instance FromJSON NetworkError where + parseJSON = $(J.mkParseJSON (sumTypeJSON $ dropPrefix "NE") ''NetworkError) + omittedField = Just NEFailedError $(J.deriveJSON (sumTypeJSON id) ''BrokerErrorType)