From 1399166ed06e8c1e5e9ca71ec7b53c8e6e2cf852 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 27 Mar 2017 15:27:03 -0700 Subject: [PATCH] Print IO exception to stderr - Printing to stdout will cause JSON parsing issues on the dotcom side --- src/GitmonClient.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GitmonClient.hs b/src/GitmonClient.hs index de9bdced7..676b39a75 100644 --- a/src/GitmonClient.hs +++ b/src/GitmonClient.hs @@ -14,10 +14,11 @@ import Git.Libgit2 import Network.Socket hiding (recv) import Network.Socket.ByteString (sendAll, recv) import Prelude -import Prologue hiding (toStrict, map, print) +import Prologue hiding (toStrict, map, print, show) import System.Clock import System.Directory (getCurrentDirectory) import System.Environment +import System.IO (hPrint, stderr) import System.Timeout import Text.Regex @@ -167,7 +168,7 @@ safeGitmonIO command = liftIO $ timeout gitmonTimeout command `catch` logError logError :: IOException -> IO (Maybe a) logError e = do - print e + hPrint stderr e pure Nothing procFileAddr :: String