Curl error messages are self contained and don't need "error" prefix;
added RpcResult Error which will be used once proper deserialization
of rpc response is in place.

Signed-off-by: Agata Murawska <[email protected]>
---
 htools/Ganeti/Rpc.hs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/htools/Ganeti/Rpc.hs b/htools/Ganeti/Rpc.hs
index f78dceb..728e73a 100644
--- a/htools/Ganeti/Rpc.hs
+++ b/htools/Ganeti/Rpc.hs
@@ -89,6 +89,7 @@ data RpcError
   = CurlDisabledError
   | CurlLayerError Node String
   | JsonDecodeError String
+  | RpcResultError String
   | OfflineNodeError Node
   deriving Eq
 
@@ -96,9 +97,11 @@ instance Show RpcError where
   show CurlDisabledError =
     "RPC/curl backend disabled at compile time"
   show (CurlLayerError node code) =
-    "Curl error for " ++ nodeName node ++ ", error " ++ code
+    "Curl error for " ++ nodeName node ++ ", " ++ code
   show (JsonDecodeError msg) =
-    "Error while decoding JSON from HTTP response " ++ msg
+    "Error while decoding JSON from HTTP response: " ++ msg
+  show (RpcResultError msg) =
+    "Error reponse received from RPC server: " ++ msg
   show (OfflineNodeError node) =
     "Node " ++ nodeName node ++ " is marked as offline"
 
-- 
1.7.7.3

Reply via email to