Fail more gracefully if file of restrictions is not accessible.
This commit is contained in:
parent
63f4aaf7dd
commit
3cc3d4fd3b
@ -85,6 +85,9 @@ int main (int argc, char *argv[]) {
|
|||||||
|
|
||||||
INFO("Using restrictions from file: " << argv[2]);
|
INFO("Using restrictions from file: " << argv[2]);
|
||||||
std::ifstream restrictionsInstream(argv[2], ios::binary);
|
std::ifstream restrictionsInstream(argv[2], ios::binary);
|
||||||
|
if(!restrictionsInstream.good()) {
|
||||||
|
ERR("Could not access <osrm-restrictions> files");
|
||||||
|
}
|
||||||
_Restriction restriction;
|
_Restriction restriction;
|
||||||
unsigned usableRestrictionsCounter(0);
|
unsigned usableRestrictionsCounter(0);
|
||||||
restrictionsInstream.read((char*)&usableRestrictionsCounter, sizeof(unsigned));
|
restrictionsInstream.read((char*)&usableRestrictionsCounter, sizeof(unsigned));
|
||||||
|
Loading…
Reference in New Issue
Block a user