summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-20 02:16:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-20 02:16:09 -0400
commit2fce3940b506a7671f622e872e049008df8ef4ad (patch)
tree9d6c6f2a5bd3840c91c403bb913f4057021674f3
parentd9f26115c32c8df6865afc291d55b83b142c8428 (diff)
catch all errors
-rw-r--r--Assistant/Threads/MountWatcher.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs
index a6c15540a..1cf854d0a 100644
--- a/Assistant/Threads/MountWatcher.hs
+++ b/Assistant/Threads/MountWatcher.hs
@@ -17,6 +17,7 @@ import Utility.ThreadScheduler
import Utility.Mounts
import Control.Concurrent
+import qualified Control.Exception as E
import qualified Data.Set as S
#if WITH_DBUS
@@ -38,7 +39,7 @@ mountWatcherThread st handle =
#if WITH_DBUS
dbusThread :: ThreadState -> DaemonStatusHandle -> IO ()
-dbusThread st handle = (go =<< connectSession) `catchIO` onerr
+dbusThread st handle = E.catch (go =<< connectSession) onerr
where
go client = ifM (checkMountMonitor client)
( do
@@ -56,6 +57,7 @@ dbusThread st handle = (go =<< connectSession) `catchIO` onerr
warning "No known volume monitor available through dbus; falling back to mtab polling"
pollinstead
)
+ onerr :: E.SomeException -> IO ()
onerr e = do
runThreadState st $
warning $ "Failed to use dbus; falling back to mtab polling (" ++ show e ++ ")"