]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - pdns-pipe-nmc.hs
return empty domain if data not found
[pdns-pipe-nmc.git] / pdns-pipe-nmc.hs
index e9b29690aa0a866f2e57749dc41efa14fe304d4f..a3fc8c7c5b2a5a414388c4f4ede60d1f6c94e1a5 100644 (file)
@@ -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