sendGetRequest :: String -> [(String, ByteString)] -> IO ByteString
sendGetRequest url args = simpleHTTP (defaultGETRequest_ url') >>= getResponseBody
- where url' = case parseURI $ unpack $ concat [pack url, "?", qstr] of
+ where url' = case parseURI url'' of
Just x -> x
- _ -> error "Bad tracker URL"
+ _ -> error $ "Bad tracker URL: " ++ (show url'')
qstr = mkParams args
+ url'' = unpack $ concat [pack url, "?", qstr]