diff options
author | vng <viktor.govako@gmail.com> | 2015-09-25 16:22:48 +0300 |
---|---|---|
committer | vng <viktor.govako@gmail.com> | 2015-09-25 17:17:52 +0300 |
commit | 25aaa05cefa9ecdd4ce6e7893786b4bf0eec5366 (patch) | |
tree | 1a988724f19463c79b18cbfa738bed7f5c7e26c8 /platform/local_country_file_utils.cpp | |
parent | c56f4c20b946bf62831e917a695d4e6c7861fdd9 (diff) |
[mwm set] Handle file system exceptions when building feature offsets index.
Diffstat (limited to 'platform/local_country_file_utils.cpp')
-rw-r--r-- | platform/local_country_file_utils.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp index 6519274861..19bcc28718 100644 --- a/platform/local_country_file_utils.cpp +++ b/platform/local_country_file_utils.cpp @@ -239,9 +239,11 @@ ModelReader * GetCountryReader(platform::LocalCountryFile const & file, MapOptio } // static -bool CountryIndexes::PreparePlaceOnDisk(LocalCountryFile const & localFile) +void CountryIndexes::PreparePlaceOnDisk(LocalCountryFile const & localFile) { - return MkDirChecked(IndexesDir(localFile)); + string const dir = IndexesDir(localFile); + if (!MkDirChecked(dir)) + MYTHROW(FileSystemException, ("Can't create directory", dir)); } // static @@ -302,6 +304,8 @@ string CountryIndexes::IndexesDir(LocalCountryFile const & localFile) string dir = localFile.GetDirectory(); CountryFile const & file = localFile.GetCountryFile(); + /// @todo It's a temporary code until we will put fIndex->fOffset into mwm container. + /// IndexesDir should not throw any exceptions. if (dir.empty()) { // Local file is stored in resources. Need to prepare index folder in the writable directory. @@ -309,7 +313,8 @@ string CountryIndexes::IndexesDir(LocalCountryFile const & localFile) ASSERT_GREATER(version, 0, ()); dir = my::JoinFoldersToPath(GetPlatform().WritableDir(), strings::to_string(version)); - VERIFY(MkDirChecked(dir), ()); + if (!MkDirChecked(dir)) + MYTHROW(FileSystemException, ("Can't create directory", dir)); } return my::JoinFoldersToPath(dir, file.GetNameWithoutExt()); |