mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
Append first few characters of binary trips result (Hafas) to exception, for debug purposes.
This commit is contained in:
parent
67db7d7b2d
commit
4591eede54
2 changed files with 15 additions and 1 deletions
|
@ -1609,13 +1609,16 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
try
|
||||
{
|
||||
final CustomBufferedInputStream bis = new CustomBufferedInputStream(ParserUtils.scrapeInputStream(uri));
|
||||
final String firstChars = ParserUtils.peekFirstChars(bis);
|
||||
|
||||
// initialize input stream
|
||||
is = new LittleEndianDataInputStream(bis);
|
||||
is.mark(expectedBufferSize);
|
||||
|
||||
// quick check of status
|
||||
final int version = is.readShortReverse();
|
||||
if (version != 6 && version != 5)
|
||||
throw new IllegalStateException("unknown version: " + version);
|
||||
throw new IllegalStateException("unknown version: " + version + ", first chars: " + firstChars);
|
||||
final ResultHeader header = new ResultHeader(SERVER_PRODUCT, Integer.toString(version), 0, null);
|
||||
|
||||
// quick seek for pointers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue