changeset 142:e7e19f042eb5

fix
author jodogne
date Thu, 11 Oct 2012 13:57:56 +0200
parents 24681d35bad9
children c7f1cea08f6f
files Core/FileStorage.cpp Core/FileStorage.h OrthancServer/ServerIndex.cpp
diffstat 3 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Core/FileStorage.cpp	Wed Oct 10 18:22:33 2012 +0200
+++ b/Core/FileStorage.cpp	Thu Oct 11 13:57:56 2012 +0200
@@ -293,6 +293,19 @@
 #endif
   }
 
+  void FileStorage::UncheckedRemove(const std::string& uuid)
+  {
+    try
+    {
+      Remove(uuid);
+    }
+    catch (boost::filesystem::filesystem_error)
+    {
+      // Ignore the error
+    }
+  }
+
+
 
   uintmax_t FileStorage::GetCapacity() const
   {
--- a/Core/FileStorage.h	Wed Oct 10 18:22:33 2012 +0200
+++ b/Core/FileStorage.h	Thu Oct 11 13:57:56 2012 +0200
@@ -82,6 +82,8 @@
 
     void Remove(const std::string& uuid);
 
+    void UncheckedRemove(const std::string& uuid);
+
     uintmax_t GetCapacity() const;
 
     uintmax_t GetAvailableSpace() const;
--- a/OrthancServer/ServerIndex.cpp	Wed Oct 10 18:22:33 2012 +0200
+++ b/OrthancServer/ServerIndex.cpp	Thu Oct 11 13:57:56 2012 +0200
@@ -607,8 +607,8 @@
 
     if (status != StoreStatus_Success)
     {
-      storage.Remove(fileUuid);
-      storage.Remove(jsonUuid);
+      storage.UncheckedRemove(fileUuid);
+      storage.UncheckedRemove(jsonUuid);
     }
 
     switch (status)