From 1cf531a5949cad1f68575188cf00d147478e029c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 23 Sep 2009 14:21:21 +0200 Subject: StorageBackendFile: Throw NOT_FOUND if a file doesn't exist rather than NOT_AVAILABLE --- src/modules/StorageBackendFile/StorageBackendFile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/StorageBackendFile/StorageBackendFile.cpp b/src/modules/StorageBackendFile/StorageBackendFile.cpp index 6a9242d..33c6b0f 100644 --- a/src/modules/StorageBackendFile/StorageBackendFile.cpp +++ b/src/modules/StorageBackendFile/StorageBackendFile.cpp @@ -147,6 +147,9 @@ boost::shared_ptr StorageBackendFile::load(const std::string &t throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::filesystem::path path = getFileName(type, name); + if(!boost::filesystem::is_regular_file(path)) + throw Core::Exception(Core::Exception::NOT_FOUND); + return boost::shared_ptr(new Common::XmlData(path.file_string())); } -- cgit v1.2.3