diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-23 14:21:21 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-23 14:21:21 +0200 |
commit | 1cf531a5949cad1f68575188cf00d147478e029c (patch) | |
tree | bdd973f6901a6c4e4865fff52a0e35219502cc21 /src/modules | |
parent | 26c1290391eb5540d6e2c5f6eceb877e0075d087 (diff) | |
download | mad-1cf531a5949cad1f68575188cf00d147478e029c.tar mad-1cf531a5949cad1f68575188cf00d147478e029c.zip |
StorageBackendFile: Throw NOT_FOUND if a file doesn't exist rather than NOT_AVAILABLE
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/StorageBackendFile/StorageBackendFile.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<Common::XmlData> 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<Common::XmlData>(new Common::XmlData(path.file_string())); } |