[routing] Add return code for non-existing routing file

This commit is contained in:
Denis Koronchik 2014-10-08 12:07:49 +03:00 committed by Alex Zolotarev
parent 4338285640
commit 6c4cc1bb03
2 changed files with 7 additions and 0 deletions

View file

@ -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));

View file

@ -19,6 +19,7 @@ public:
NoError = 0,
Cancelled,
InconsistentMWMandRoute,
RouteFileNotExist,
StartPointNotFound,
EndPointNotFound,
PointsInDifferentMWM,