forked from organicmaps/organicmaps
[routing] Add return code for non-existing routing file
This commit is contained in:
parent
4338285640
commit
6c4cc1bb03
2 changed files with 7 additions and 0 deletions
|
@ -253,6 +253,9 @@ void OsrmRouter::CalculateRouteAsync(ReadyCallback const & callback)
|
|||
case RouteNotFound:
|
||||
LOG(LWARNING, ("Route not found"));
|
||||
break;
|
||||
case RouteFileNotExist:
|
||||
LOG(LWARNING, ("There are no routing file"));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -298,6 +301,9 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRouteImpl(m2::PointD const & startPt
|
|||
fName += DATA_FILE_EXTENSION;
|
||||
|
||||
string const fPath = pl.WritablePathForFile(fName + ROUTING_FILE_EXTENSION);
|
||||
if (!pl.IsFileExistsByFullPath(fPath))
|
||||
return RouteFileNotExist;
|
||||
|
||||
if (NeedReload(fPath))
|
||||
{
|
||||
LOG(LDEBUG, ("Load routing index for file:", fPath));
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
NoError = 0,
|
||||
Cancelled,
|
||||
InconsistentMWMandRoute,
|
||||
RouteFileNotExist,
|
||||
StartPointNotFound,
|
||||
EndPointNotFound,
|
||||
PointsInDifferentMWM,
|
||||
|
|
Loading…
Add table
Reference in a new issue