catch all errors
This commit is contained in:
parent
d9f26115c3
commit
2fce3940b5
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,7 @@ import Utility.ThreadScheduler
|
||||||
import Utility.Mounts
|
import Utility.Mounts
|
||||||
|
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
|
import qualified Control.Exception as E
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
#if WITH_DBUS
|
#if WITH_DBUS
|
||||||
|
@ -38,7 +39,7 @@ mountWatcherThread st handle =
|
||||||
#if WITH_DBUS
|
#if WITH_DBUS
|
||||||
|
|
||||||
dbusThread :: ThreadState -> DaemonStatusHandle -> IO ()
|
dbusThread :: ThreadState -> DaemonStatusHandle -> IO ()
|
||||||
dbusThread st handle = (go =<< connectSession) `catchIO` onerr
|
dbusThread st handle = E.catch (go =<< connectSession) onerr
|
||||||
where
|
where
|
||||||
go client = ifM (checkMountMonitor client)
|
go client = ifM (checkMountMonitor client)
|
||||||
( do
|
( 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"
|
warning "No known volume monitor available through dbus; falling back to mtab polling"
|
||||||
pollinstead
|
pollinstead
|
||||||
)
|
)
|
||||||
|
onerr :: E.SomeException -> IO ()
|
||||||
onerr e = do
|
onerr e = do
|
||||||
runThreadState st $
|
runThreadState st $
|
||||||
warning $ "Failed to use dbus; falling back to mtab polling (" ++ show e ++ ")"
|
warning $ "Failed to use dbus; falling back to mtab polling (" ++ show e ++ ")"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue