mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 23:28:48 +00:00
AbstractHafasClientInterfaceProvider: Handle missing 'errTxt' when an error is signalled.
This commit is contained in:
parent
9e99ea59d2
commit
6e9cfcd00f
1 changed files with 4 additions and 4 deletions
|
@ -177,7 +177,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
final JSONObject head = new JSONObject(page.toString());
|
||||
final String headErr = head.optString("err", null);
|
||||
if (headErr != null && !"OK".equals(headErr)) {
|
||||
final String headErrTxt = head.getString("errTxt");
|
||||
final String headErrTxt = head.optString("errTxt");
|
||||
throw new RuntimeException(headErr + " " + headErrTxt);
|
||||
}
|
||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT, head.getString("ver"), null, 0, null);
|
||||
|
@ -243,7 +243,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
final JSONObject head = new JSONObject(page.toString());
|
||||
final String headErr = head.optString("err", null);
|
||||
if (headErr != null && !"OK".equals(headErr)) {
|
||||
final String headErrTxt = head.getString("errTxt");
|
||||
final String headErrTxt = head.optString("errTxt");
|
||||
throw new RuntimeException(headErr + " " + headErrTxt);
|
||||
}
|
||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT, head.getString("ver"), null, 0, null);
|
||||
|
@ -353,7 +353,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
final JSONObject head = new JSONObject(page.toString());
|
||||
final String headErr = head.optString("err", null);
|
||||
if (headErr != null && !"OK".equals(headErr)) {
|
||||
final String headErrTxt = head.getString("errTxt");
|
||||
final String headErrTxt = head.optString("errTxt");
|
||||
throw new RuntimeException(headErr + " " + headErrTxt);
|
||||
}
|
||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT, head.getString("ver"), null, 0, null);
|
||||
|
@ -458,7 +458,7 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
|||
final JSONObject head = new JSONObject(page.toString());
|
||||
final String headErr = head.optString("err", null);
|
||||
if (headErr != null && !"OK".equals(headErr)) {
|
||||
final String headErrTxt = head.getString("errTxt");
|
||||
final String headErrTxt = head.optString("errTxt");
|
||||
throw new RuntimeException(headErr + " " + headErrTxt);
|
||||
}
|
||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT, head.getString("ver"), null, 0, null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue