aboutsummaryrefslogtreecommitdiff
path: root/Utility/Url.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-27 13:01:57 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-27 13:01:57 -0400
commit7d3c9911fcdf29c8b02140212428fea8437d8abb (patch)
treea24da6a208b21f149242790850427673502f2684 /Utility/Url.hs
parent2cdb58ca13b5942eb6aa71fcf2d971d5c408d041 (diff)
avoid exception when curl exits nonzero (due to eg, bad domain name)
Diffstat (limited to 'Utility/Url.hs')
-rw-r--r--Utility/Url.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs
index 3ab14ebe4..eddcd0a5d 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