# HG changeset patch
# User jodogne
# Date 1349956676 -7200
# Node ID e7e19f042eb55e30b4bf4564eb58f037143ede11
# Parent  24681d35bad9f5f767a35535dfa7b4ad5c941a5a
fix

diff -r 24681d35bad9 -r e7e19f042eb5 Core/FileStorage.cpp
--- 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
   {
diff -r 24681d35bad9 -r e7e19f042eb5 Core/FileStorage.h
--- 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;
diff -r 24681d35bad9 -r e7e19f042eb5 OrthancServer/ServerIndex.cpp
--- 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)