changed error message for missing datafile to include filename
This commit is contained in:
parent
5f34b5cf41
commit
0fe5d5144a
3 changed files with 18 additions and 2 deletions
|
@ -298,9 +298,13 @@ public class RoutingEngine extends Thread
|
|||
return mwp;
|
||||
}
|
||||
}
|
||||
if ( minRingWith == 1 && nodesCache.first_file_access_failed )
|
||||
{
|
||||
throw new IllegalArgumentException( "datafile " + nodesCache.first_file_access_name + " not found" );
|
||||
}
|
||||
if ( minRingWith++ == 5 )
|
||||
{
|
||||
throw new IllegalArgumentException( wp.name + "-position not mapped" );
|
||||
throw new IllegalArgumentException( wp.name + "-position not mapped in existing datafile" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@ public final class NodesCache
|
|||
public DistanceChecker distanceChecker;
|
||||
|
||||
public boolean oom_carsubset_hint = false;
|
||||
public boolean first_file_access_failed = false;
|
||||
public String first_file_access_name;
|
||||
|
||||
private long cacheSum = 0;
|
||||
private boolean garbageCollectionEnabled = false;
|
||||
|
@ -48,6 +50,9 @@ public final class NodesCache
|
|||
this.carMode = carMode;
|
||||
this.forceSecondaryData = forceSecondaryData;
|
||||
|
||||
first_file_access_failed = false;
|
||||
first_file_access_name = null;
|
||||
|
||||
if ( !this.segmentDir.isDirectory() ) throw new RuntimeException( "segment directory " + segmentDir + " does not exist" );
|
||||
|
||||
if ( oldCache != null )
|
||||
|
@ -249,6 +254,13 @@ public final class NodesCache
|
|||
OsmFile osmf = new OsmFile( ra, tileIndex, iobuffer );
|
||||
osmf.lonDegree = lonDegree;
|
||||
osmf.latDegree = latDegree;
|
||||
|
||||
if ( first_file_access_name == null )
|
||||
{
|
||||
first_file_access_name = currentFileName;
|
||||
first_file_access_failed = osmf.filename == null;
|
||||
}
|
||||
|
||||
return osmf;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RouterTest
|
|||
|
||||
msg = calcRoute( 8.720897, 50.002515, 16.723658, 49.997510, "notrack" );
|
||||
|
||||
Assert.assertTrue( msg, msg != null && msg.indexOf( "not mapped" ) >= 0 );
|
||||
Assert.assertTrue( msg, msg != null && msg.indexOf( "not found" ) >= 0 );
|
||||
}
|
||||
|
||||
private String calcRoute( double flon, double flat, double tlon, double tlat, String trackname ) throws Exception
|
||||
|
|
Loading…
Reference in a new issue