From: Eugene Crosser Date: Sat, 29 Mar 2014 19:45:48 +0000 (+0400) Subject: return empty domain if data not found X-Git-Tag: 0.9.0.0~111 X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=b2f5f20509c12bb94783f7035042aed1e0d99c58;p=pdns-pipe-nmc.git return empty domain if data not found --- diff --git a/pdns-pipe-nmc.hs b/pdns-pipe-nmc.hs index e9b2969..a3fc8c7 100644 --- a/pdns-pipe-nmc.hs +++ b/pdns-pipe-nmc.hs @@ -41,7 +41,10 @@ qReq cf q id = applyBasicAuth (C.pack (rpcuser cf)) (C.pack (rpcpassword cf)) qRsp :: Response ByteString -> Either String NmcDom qRsp rsp = case parseJsonRpc (responseBody rsp) :: Either JsonRpcError NmcRes of - Left jerr -> Left $ "Unparseable response: " ++ (show (responseBody rsp)) + Left jerr -> + case (jrpcErrCode jerr) of + -4 -> Right emptyNmcDom + _ -> Left $ "JsonRpc error response: " ++ (show jerr) Right jrsp -> case resValue jrsp of "" -> Right emptyNmcDom