avoid ugly error about MVar if the sqlite worker thread crashes

This commit is contained in:
Joey Hess 2015-10-12 13:00:22 -04:00
parent fa9333e99f
commit 5072c62932
Failed to extract signature

View file

@ -137,7 +137,8 @@ queryDb (DbHandle _ jobs _) a = do
res <- newEmptyMVar
putMVar jobs $ QueryJob $
liftIO . putMVar res =<< tryNonAsync a
either throwIO return =<< takeMVar res
(either throwIO return =<< takeMVar res)
`catchNonAsync` (const $ error "sqlite query crashed")
closeDb :: DbHandle -> IO ()
closeDb h@(DbHandle worker jobs _) = do