From 7e96fa97322c957fd2feda1447a5cef226e532b6 Mon Sep 17 00:00:00 2001 From: Marius Rackwitz Date: Tue, 1 Dec 2015 12:54:32 +0100 Subject: [PATCH] Catch File::NotFound and rethrow correctly --- shared_realm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared_realm.cpp b/shared_realm.cpp index 2e4f2b03..bbafc970 100644 --- a/shared_realm.cpp +++ b/shared_realm.cpp @@ -84,6 +84,10 @@ Realm::Realm(Config config) throw RealmFileException(RealmFileException::Kind::Exists, ex.get_path(), "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) { throw RealmFileException(RealmFileException::Kind::AccessError, ex.get_path(), "Unable to open a realm at path '" + ex.get_path() + "'");