mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 22:19:50 +00:00
moved empty page retry mechanism to ParserUtils
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@83 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f74f4419b7
commit
6648d8fa30
2 changed files with 14 additions and 19 deletions
|
@ -85,7 +85,16 @@ public final class ParserUtils
|
|||
}
|
||||
|
||||
pageReader.close();
|
||||
return buffer;
|
||||
|
||||
if (buffer.length() > 0)
|
||||
return buffer;
|
||||
else
|
||||
{
|
||||
if (tries-- > 0)
|
||||
System.out.println("got empty page, retrying...");
|
||||
else
|
||||
throw new IOException("got empty page: " + url);
|
||||
}
|
||||
}
|
||||
catch (final SocketTimeoutException x)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue