- Left jerr -> Left $ "Unparseable response: " ++ (show (responseBody rsp))
- Right jrsp ->
- case resValue jrsp of
- "" -> Right emptyNmcDom
- vstr ->
- case decode vstr :: Maybe NmcDom of
- Nothing -> Left $ "Unparseable value: " ++ (show vstr)
- Just dom -> Right dom
+ Left jerr ->
+ case (jrpcErrCode jerr) of
+ -4 -> Right "{}" -- this is how non-existent entry is returned
+ _ -> Left $ "JsonRpc error response: " ++ (show jerr)
+ Right jrsp -> Right $ resValue jrsp