Catch File::NotFound and rethrow correctly
This commit is contained in:
parent
e8a26aa533
commit
7e96fa9732
|
@ -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