From 0d544649d0039e66fe9128ac8e5ef7fe6e1cd538 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 Jan 2014 21:24:17 -0400 Subject: [PATCH] catch exception checking if url exists when network is disconnected Leads to better failure message (or possibly fallback to another remote). --- Remote/Web.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Remote/Web.hs b/Remote/Web.hs index 975279edd9..2863d9d5e4 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -118,7 +118,8 @@ checkKey' key us = firsthit us (Right False) $ \u -> do #endif DefaultDownloader -> do headers <- getHttpHeaders - Right <$> Url.withUserAgent (Url.checkBoth u' headers $ keySize key) + Url.withUserAgent $ catchMsgIO . + Url.checkBoth u' headers (keySize key) where firsthit [] miss _ = return miss firsthit (u:rest) _ a = do