better error message when finding HTML instead of metainfo

This commit is contained in:
zzz
2010-02-17 19:56:54 +00:00
parent 7701693d37
commit d4f1230b37

View File

@ -279,7 +279,9 @@ public class BDecoder
public BEValue bdecodeMap() throws IOException
{
int c = getNextIndicator();
if (c != 'd')
if (c == '<')
throw new InvalidBEncodingException("Expected a .torrent metainfo file but found HTML? Check URL or file!");
else if (c != 'd')
throw new InvalidBEncodingException("Expected 'd', not '"
+ (char)c + "'");
indicator = 0;