Exception handling

This commit is contained in:
Roman Inflianskas 2016-05-16 15:54:13 +03:00
parent 4ad562867e
commit 07078620ae

View file

@ -593,7 +593,12 @@ public class BinaryMapIndexReader {
}
public int preloadStreets(City c, SearchRequest<Street> resultMatcher) throws IOException {
AddressRegion reg = checkAddressIndex(c.getFileOffset());
AddressRegion reg;
try {
reg = checkAddressIndex(c.getFileOffset());
} catch (IllegalArgumentException e) {
throw new IOException(e.getMessage() + " while reading " + c + " (id: " + c.getId() + ")");
}
codedIS.seek(c.getFileOffset());
int size = codedIS.readRawVarint32();
int old = codedIS.pushLimit(size);