From 16387edd00ce6df9591bb61b9f13f86855edd746 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Mar 2014 13:01:57 -0400 Subject: [PATCH] avoid exception when curl exits nonzero (due to eg, bad domain name) --- Utility/Url.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utility/Url.hs b/Utility/Url.hs index 3ab14ebe49..eddcd0a5d0 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -77,7 +77,8 @@ exists url uo = case parseURIRelaxed url of Nothing -> dne | otherwise -> if Build.SysConfig.curl then do - output <- readProcess "curl" $ toCommand curlparams + output <- catchDefaultIO "" $ + readProcess "curl" $ toCommand curlparams case lastMaybe (lines output) of Just ('2':_:_) -> return (True, extractsize output) _ -> dne