mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 08:40:29 +00:00
parse more error codes
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@478 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
2c62acf726
commit
19ae3d3fbb
1 changed files with 10 additions and 1 deletions
|
@ -280,12 +280,21 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
if (XmlPullUtil.test(pp, "Err"))
|
||||
{
|
||||
final String code = XmlPullUtil.attr(pp, "code");
|
||||
if (code.equals("K9380"))
|
||||
if (code.equals("K9380") || code.equals("K895")) // Departure/Arrival are too near
|
||||
return QueryConnectionsResult.TOO_CLOSE;
|
||||
if (code.equals("K9220")) // Nearby to the given address stations could not be found
|
||||
return QueryConnectionsResult.UNRESOLVABLE_ADDRESS;
|
||||
if (code.equals("K9240")) // Internal error
|
||||
return new QueryConnectionsResult(Status.SERVICE_DOWN);
|
||||
if (code.equals("K9260")) // Departure station does not exist
|
||||
return QueryConnectionsResult.NO_CONNECTIONS;
|
||||
if (code.equals("K890")) // No connections found
|
||||
return QueryConnectionsResult.NO_CONNECTIONS;
|
||||
if (code.equals("K891")) // No route found (try entering an intermediate station)
|
||||
return QueryConnectionsResult.NO_CONNECTIONS;
|
||||
if (code.equals("K899")) // An error occurred
|
||||
return new QueryConnectionsResult(Status.SERVICE_DOWN);
|
||||
// if (code.equals("K1:890")) // Unsuccessful or incomplete search (direction: forward)
|
||||
throw new IllegalStateException("error " + code + " " + XmlPullUtil.attr(pp, "text"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue