# HG changeset patch
# User Sebastien Jodogne <s.jodogne@gmail.com>
# Date 1582724218 -3600
# Node ID 2eeaa076c8f6b60cc7c8a56bb9a93e0d2c9139a6
# Parent  736907ecb626df76e93012cbae742bfcb469db95# Parent  643b5ee86f92fa1499eef4b73681f8af69a83cd8
integration mainline->storage-commitment

diff -r 736907ecb626 -r 2eeaa076c8f6 OrthancServer/ServerIndex.cpp
--- a/OrthancServer/ServerIndex.cpp	Wed Feb 26 13:22:35 2020 +0100
+++ b/OrthancServer/ServerIndex.cpp	Wed Feb 26 14:36:58 2020 +0100
@@ -152,7 +152,15 @@
              it = pendingFilesToRemove_.begin();
            it != pendingFilesToRemove_.end(); ++it)
       {
-        context_.RemoveFile(it->GetUuid(), it->GetContentType());
+        try
+        {
+          context_.RemoveFile(it->GetUuid(), it->GetContentType());
+        }
+        catch (OrthancException& e)
+        {
+          LOG(ERROR) << "Unable to remove an attachment from the storage area: "
+                     << it->GetUuid() << " (type: " << EnumerationToString(it->GetContentType()) << ")";
+        }
       }
     }