diff options
-rw-r--r-- | src/Network/BitTorrent/Tracker/RPC.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/RPC.hs b/src/Network/BitTorrent/Tracker/RPC.hs index 48048964..0ffb2017 100644 --- a/src/Network/BitTorrent/Tracker/RPC.hs +++ b/src/Network/BitTorrent/Tracker/RPC.hs | |||
@@ -122,9 +122,10 @@ withManager opts info = bracket (newManager opts info) closeManager | |||
122 | -- TODO Catch IO exceptions on rpc calls (?) | 122 | -- TODO Catch IO exceptions on rpc calls (?) |
123 | 123 | ||
124 | data RpcException | 124 | data RpcException |
125 | = UdpException UDP.RpcException -- ^ | 125 | = UdpException UDP.RpcException -- ^ UDP RPC driver failure; |
126 | | HttpException HTTP.RpcException -- ^ | 126 | | HttpException HTTP.RpcException -- ^ HTTP RPC driver failure; |
127 | | UnknownProtocol String -- ^ unknown tracker protocol scheme | 127 | | UnrecognizedProtocol String -- ^ unsupported scheme in announce URI; |
128 | | GenericException String -- ^ for furter extensibility. | ||
128 | deriving (Show, Typeable) | 129 | deriving (Show, Typeable) |
129 | 130 | ||
130 | instance Exception RpcException | 131 | instance Exception RpcException |
@@ -141,7 +142,7 @@ dispatch :: URI -> IO a -> IO a -> IO a | |||
141 | dispatch URI {..} http udp | 142 | dispatch URI {..} http udp |
142 | | uriScheme == "http:" = packException HttpException http | 143 | | uriScheme == "http:" = packException HttpException http |
143 | | uriScheme == "udp:" = packException UdpException udp | 144 | | uriScheme == "udp:" = packException UdpException udp |
144 | | otherwise = throwIO $ UnknownProtocol uriScheme | 145 | | otherwise = throwIO $ UnrecognizedProtocol uriScheme |
145 | 146 | ||
146 | announce :: Manager -> URI -> SAnnounceQuery -> IO AnnounceInfo | 147 | announce :: Manager -> URI -> SAnnounceQuery -> IO AnnounceInfo |
147 | announce Manager {..} uri simpleQuery | 148 | announce Manager {..} uri simpleQuery |