X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=pdns-pipe-nmc.hs;h=a3fc8c7c5b2a5a414388c4f4ede60d1f6c94e1a5;hp=e9b29690aa0a866f2e57749dc41efa14fe304d4f;hb=b2f5f20509c12bb94783f7035042aed1e0d99c58;hpb=9ef6b8b7e3a1eeb20cdde32541e6d2aa549ba3b1 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