summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-01-09 04:33:13 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-01-09 04:33:13 +0400
commit408c48e657f3f40b80ef5ba1cbdb3871de20857a (patch)
tree07bcda6b900b8440d5d2d79e4ed34272253ff997
parent71a3ffda743f14da3a9828ddc20b69b4f185e1f4 (diff)
Fix query exception handling
-rw-r--r--src/Network/BitTorrent/DHT.hs4
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
34import Control.Monad.Trans 34import Control.Monad.Trans
35import Data.Conduit as C 35import Data.Conduit as C
36import Data.Conduit.List as C 36import Data.Conduit.List as C
37import Data.List as L
37import Data.Monoid 38import Data.Monoid
38import Data.Text as T 39import Data.Text as T
39import Network.Socket (PortNumber) 40import Network.Socket (PortNumber)
@@ -41,6 +42,7 @@ import Text.PrettyPrint as PP hiding ((<>), ($$))
41import Text.PrettyPrint.Class 42import Text.PrettyPrint.Class
42 43
43import Data.Torrent.InfoHash 44import Data.Torrent.InfoHash
45import Network.KRPC (QueryFailure)
44import Network.BitTorrent.Core 46import Network.BitTorrent.Core
45import Network.BitTorrent.DHT.Message 47import Network.BitTorrent.DHT.Message
46import Network.BitTorrent.DHT.Routing 48import 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: " <>