From 6fddde87e13cea6b790b8175ec6d86e517c8846c Mon Sep 17 00:00:00 2001
From: Agata Murawska <agatamurawska@google.com>
Date: Fri, 21 Sep 2012 11:20:34 +0200
Subject: [PATCH] Cleanup for RPC errors

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 <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 htools/Ganeti/Rpc.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/htools/Ganeti/Rpc.hs b/htools/Ganeti/Rpc.hs
index f78dceb92..728e73a0d 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"
 
-- 
GitLab