Merge pull request #31 from realm/tg-file-not-found
Catch File::NotFound and rethrow correctly
This commit is contained in:
commit
854d6bea53
|
@ -84,6 +84,10 @@ Realm::Realm(Config config)
|
||||||
throw RealmFileException(RealmFileException::Kind::Exists, ex.get_path(),
|
throw RealmFileException(RealmFileException::Kind::Exists, ex.get_path(),
|
||||||
"File at path '" + ex.get_path() + "' already exists.");
|
"File at path '" + ex.get_path() + "' already exists.");
|
||||||
}
|
}
|
||||||
|
catch (util::File::NotFound const& ex) {
|
||||||
|
throw RealmFileException(RealmFileException::Kind::NotFound, ex.get_path(),
|
||||||
|
"File at path '" + ex.get_path() + "' does not exist.");
|
||||||
|
}
|
||||||
catch (util::File::AccessError const& ex) {
|
catch (util::File::AccessError const& ex) {
|
||||||
throw RealmFileException(RealmFileException::Kind::AccessError, ex.get_path(),
|
throw RealmFileException(RealmFileException::Kind::AccessError, ex.get_path(),
|
||||||
"Unable to open a realm at path '" + ex.get_path() + "'");
|
"Unable to open a realm at path '" + ex.get_path() + "'");
|
||||||
|
|
Loading…
Reference in New Issue