diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-11 02:51:28 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-11 02:51:28 +0400 |
commit | b00e3a9dc4ac3de58838ce15c602c88e345f7c75 (patch) | |
tree | 9a159f3aaf9f0a566685e0e750f5fa192476d55b | |
parent | 772e0d6974f955465345fd3055a3ffde71282a4d (diff) |
More informative error messages in metadata parsing
-rw-r--r-- | src/Network/BitTorrent/Exchange/Message.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Message.hs b/src/Network/BitTorrent/Exchange/Message.hs index f848f4cb..fee3ad36 100644 --- a/src/Network/BitTorrent/Exchange/Message.hs +++ b/src/Network/BitTorrent/Exchange/Message.hs | |||
@@ -868,8 +868,8 @@ getMetadata len | |||
868 | where | 868 | where |
869 | parseError reason = "unable to parse metadata message: " ++ reason | 869 | parseError reason = "unable to parse metadata message: " ++ reason |
870 | 870 | ||
871 | parseRes (BS.Fail _ _ _) = fail $ parseError "bdict: possible corrupted" | 871 | parseRes (BS.Fail _ _ m) = fail $ parseError $ "bdict: " ++ m |
872 | parseRes (BS.Partial _) = fail $ parseError "bdict: not enough bytes" | 872 | parseRes (BS.Partial _) = fail $ parseError "bdict: not enough bytes" |
873 | parseRes (BS.Done piece bvalueBS) | 873 | parseRes (BS.Done piece bvalueBS) |
874 | | BS.length piece > metadataPieceSize | 874 | | BS.length piece > metadataPieceSize |
875 | = fail "infodict piece: size exceeded limit" | 875 | = fail "infodict piece: size exceeded limit" |