diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-01-09 04:33:13 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-01-09 04:33:13 +0400 |
commit | 408c48e657f3f40b80ef5ba1cbdb3871de20857a (patch) | |
tree | 07bcda6b900b8440d5d2d79e4ed34272253ff997 /src/Network/BitTorrent | |
parent | 71a3ffda743f14da3a9828ddc20b69b4f185e1f4 (diff) |
Fix query exception handling
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/DHT.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index 45cde70f..7f1fa295 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs | |||
@@ -34,6 +34,7 @@ import Control.Monad.Logger | |||
34 | import Control.Monad.Trans | 34 | import Control.Monad.Trans |
35 | import Data.Conduit as C | 35 | import Data.Conduit as C |
36 | import Data.Conduit.List as C | 36 | import Data.Conduit.List as C |
37 | import Data.List as L | ||
37 | import Data.Monoid | 38 | import Data.Monoid |
38 | import Data.Text as T | 39 | import Data.Text as T |
39 | import Network.Socket (PortNumber) | 40 | import Network.Socket (PortNumber) |
@@ -41,6 +42,7 @@ import Text.PrettyPrint as PP hiding ((<>), ($$)) | |||
41 | import Text.PrettyPrint.Class | 42 | import Text.PrettyPrint.Class |
42 | 43 | ||
43 | import Data.Torrent.InfoHash | 44 | import Data.Torrent.InfoHash |
45 | import Network.KRPC (QueryFailure) | ||
44 | import Network.BitTorrent.Core | 46 | import Network.BitTorrent.Core |
45 | import Network.BitTorrent.DHT.Message | 47 | import Network.BitTorrent.DHT.Message |
46 | import Network.BitTorrent.DHT.Routing | 48 | import Network.BitTorrent.DHT.Routing |
@@ -120,7 +122,7 @@ bootstrap startNodes = do | |||
120 | result <- try $ FindNode nid <@> addr | 122 | result <- try $ FindNode nid <@> addr |
121 | case result of | 123 | case result of |
122 | Left e -> do | 124 | Left e -> do |
123 | $(logWarnS) "bootstrap" $ T.pack $ show (e :: IOError) | 125 | $(logWarnS) "bootstrap" $ T.pack $ show (e :: QueryFailure) |
124 | 126 | ||
125 | Right (NodeFound closest) -> do | 127 | Right (NodeFound closest) -> do |
126 | $(logDebug) $ "Get a list of closest nodes: " <> | 128 | $(logDebug) $ "Get a list of closest nodes: " <> |