From ca59e5cfac34d8a59203e91fdd9dd432f537c346 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 22 Dec 2013 04:56:48 +0400 Subject: Fix warnings --- src/Network/KRPC/Manager.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Network/KRPC/Manager.hs b/src/Network/KRPC/Manager.hs index 0b090e6b..c63967d0 100644 --- a/src/Network/KRPC/Manager.hs +++ b/src/Network/KRPC/Manager.hs @@ -148,11 +148,13 @@ query addr params = do sendMessage sock addr q `onException` unregisterQuery (tid, addr) pendingCalls - mres <- timeout (queryTimeout * 10 ^ 6) $ queryResponse ares + mres <- timeout (queryTimeout * 10 ^ (6 :: Int)) $ do + queryResponse ares + case mres of Just res -> return res Nothing -> do - unregisterQuery (tid, addr) pendingCalls + _ <- unregisterQuery (tid, addr) pendingCalls throwIO $ timeoutExpired tid {----------------------------------------------------------------------- -- cgit v1.2.3