diff options
author | vng <viktor.govako@gmail.com> | 2011-11-25 03:54:40 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:28:52 +0300 |
commit | 90b9e3c3cf6c1929234088a0e7686466a1c9e1a1 (patch) | |
tree | c724666106493765de579142598fbc03b67e7bc5 /indexer/classificator_loader.cpp | |
parent | 13a7ef1f6b9b344915b94c10527d476398bb82aa (diff) |
Do not halt when drules_proto.bin is absent. Reading drules_proto.txt.
Diffstat (limited to 'indexer/classificator_loader.cpp')
-rw-r--r-- | indexer/classificator_loader.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp index 6b2d80026e..6c11be5646 100644 --- a/indexer/classificator_loader.cpp +++ b/indexer/classificator_loader.cpp @@ -68,26 +68,19 @@ namespace classificator try { - // Load from protobuffer binary file. + // Load from proto buffer binary file. ReaderStreamBuf buffer(p.GetReader(DRAWING_RULES_BIN_FILE)); istream s(&buffer); rules.LoadFromBinaryProto(s); } - catch (Reader::OpenException const &) + catch (FileAbsentException const &) { - try - { - // Load from protobuffer text file. - string buffer; - ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer); - - rules.LoadFromTextProto(buffer); - } - catch (Reader::OpenException const &) - { - LOG(LERROR, ("No drawing rules found")); - } + // Load from proto buffer text file. + string buffer; + ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer); + + rules.LoadFromTextProto(buffer); } LOG(LINFO, ("Reading of classificator finished")); |