parse 'unresolvable address'

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@350 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-11-12 23:45:01 +00:00
parent 5e82b7ccf8
commit 0a148cef5c
4 changed files with 15 additions and 8 deletions

View file

@ -157,7 +157,8 @@ public class RmvProvider extends AbstractHafasProvider
private static final Pattern P_ADDRESSES = Pattern.compile(
"<span class=\"tplight\">.*?<a href=\"http://www.rmv.de/auskunft/bin/jp/query.exe/dox.*?\">\\s*(.*?)\\s*</a>.*?</span>", Pattern.DOTALL);
private static final Pattern P_CHECK_CONNECTIONS_ERROR = Pattern.compile(
"(mehrfach vorhanden oder identisch)|(keine Verbindung gefunden werden)|(derzeit nur Ausk&#252;nfte vom)", Pattern.CASE_INSENSITIVE);
"(mehrfach vorhanden oder identisch)|(keine geeigneten Haltestellen)|(keine Verbindung gefunden)|(derzeit nur Ausk&#252;nfte vom)",
Pattern.CASE_INSENSITIVE);
@Override
public QueryConnectionsResult queryConnections(final Location from, final Location via, final Location to, final Date date, final boolean dep,
@ -172,8 +173,10 @@ public class RmvProvider extends AbstractHafasProvider
if (mError.group(1) != null)
return QueryConnectionsResult.TOO_CLOSE;
if (mError.group(2) != null)
return QueryConnectionsResult.NO_CONNECTIONS;
return QueryConnectionsResult.UNRESOLVABLE_ADDRESS;
if (mError.group(3) != null)
return QueryConnectionsResult.NO_CONNECTIONS;
if (mError.group(4) != null)
return QueryConnectionsResult.INVALID_DATE;
}