[more readable error output
martin.hofmann@uni-bamberg.de**20091218091042] hunk ./src/IOInterpreter.hs 31
-    ok <- runInterpreter $ loadModules [f]
-    case ok of
-        Right _  -> return ()
-        Left e   -> fail (show e)
+    (runInterpreter $ loadModules [f]) >>= either handleIErr (return . const ())
hunk ./src/IOInterpreter.hs 35
-    r <- runInterpreter $ evalString m s
-    case r of
-        Right r  -> return r
-        Left err -> fail (show err)       
+    (runInterpreter $ evalString m s) >>= either handleIErr return       
hunk ./src/IOInterpreter.hs 42
-        lift (putStrLn m)
hunk ./src/IOInterpreter.hs 47
-        lift (putStrLn m)
hunk ./src/IOInterpreter.hs 48
-        lift (print ms)
hunk ./src/IOInterpreter.hs 56
-
hunk ./src/IOInterpreter.hs 57
+handleIErr (UnknownError s) = fail . unlines $ ["UnknownError",s]  
+handleIErr (WontCompile e)  = fail . unlines $ map errMsg e 
+handleIErr (NotAllowed s)   = fail . unlines $ ["NotAllowed",s] 
+handleIErr (GhcException s) = fail . unlines $ ["GhcException",s] 
hunk ./src/Igor2/UI/UIStarter.hs 326
-reportError s e = putDoc $ (red. text $ "ERROR:") <+>  text s <+> (text.show $ e) <> linebreak
+reportError :: (Show a) => String -> a -> IO ()                  
+reportError s e = putDoc $ align ( (red. text $ "ERROR:") <+> 
+                           vsep (text s : (map text (lines . show $ e))) <> 
+                           linebreak)