diff --git a/htools/Ganeti/HTools/ExtLoader.hs b/htools/Ganeti/HTools/ExtLoader.hs index 9be8dc7ce8256f3c394d88e9e0c8e88aa3b07504..3374de6c92990ae6e67566b88c5b4402033dd363 100644 --- a/htools/Ganeti/HTools/ExtLoader.hs +++ b/htools/Ganeti/HTools/ExtLoader.hs @@ -116,8 +116,8 @@ loadExternalData opts = do (case ldresult of Ok x -> return x Bad s -> do - hPrintf stderr "Error: failed to load data. Details:\n%s\n" s - :: IO () + hPrintf stderr + "Error: failed to load data, aborting. Details:\n%s\n" s:: IO () exitWith $ ExitFailure 1 ) let (fix_msgs, nl) = checkData (cdNodes cdata) (cdInstances cdata) diff --git a/htools/Ganeti/HTools/Luxi.hs b/htools/Ganeti/HTools/Luxi.hs index d918ecfebe830abc331741f82808166c5cb087eb..28128fc03ef4187cefb935cbe8340d3284c9861c 100644 --- a/htools/Ganeti/HTools/Luxi.hs +++ b/htools/Ganeti/HTools/Luxi.hs @@ -59,7 +59,8 @@ genericConvert :: (Text.JSON.JSON a) => -> JSValue -- ^ The value we try to convert -> Result a -- ^ The annotated result genericConvert otype oname oattr = - annotateResult (otype ++ " '" ++ oname ++ "', attribute '" ++ + annotateResult (otype ++ " '" ++ oname ++ + "', error while reading attribute '" ++ oattr ++ "'") . fromJVal -- * Data querying functionality diff --git a/htools/Ganeti/HTools/Rapi.hs b/htools/Ganeti/HTools/Rapi.hs index 936fc442877af9690dc6e9d22b3e433b7e81c344..fbcbf4bbe690797a2c469335274ac26dd2b33cfd 100644 --- a/htools/Ganeti/HTools/Rapi.hs +++ b/htools/Ganeti/HTools/Rapi.hs @@ -107,7 +107,7 @@ parseInstance :: NameAssoc -> Result (String, Instance.Instance) parseInstance ktn a = do name <- tryFromObj "Parsing new instance" a "name" - let owner_name = "Instance '" ++ name ++ "'" + let owner_name = "Instance '" ++ name ++ "', error while parsing data" let extract s x = tryFromObj owner_name x s disk <- extract "disk_usage" a beparams <- liftM fromJSObject (extract "beparams" a) @@ -131,7 +131,7 @@ parseInstance ktn a = do parseNode :: NameAssoc -> [(String, JSValue)] -> Result (String, Node.Node) parseNode ktg a = do name <- tryFromObj "Parsing new node" a "name" - let desc = "Node '" ++ name ++ "'" + let desc = "Node '" ++ name ++ "', error while parsing data" extract s = tryFromObj desc a s offline <- extract "offline" drained <- extract "drained"