changeset 3698:356ebef2cd95

prevent crash on full disk
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Feb 2020 12:15:29 +0100
parents 5331918773e7
children efa815dd2c20
files OrthancServer/ServerIndex.cpp
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Wed Feb 26 11:57:59 2020 +0100
+++ b/OrthancServer/ServerIndex.cpp	Wed Feb 26 12:15:29 2020 +0100
@@ -500,7 +500,16 @@
       Logging::Flush();
 
       boost::mutex::scoped_lock lock(that->mutex_);
-      that->db_.FlushToDisk();
+
+      try
+      {
+        that->db_.FlushToDisk();
+      }
+      catch (OrthancException&)
+      {
+        LOG(ERROR) << "Cannot flush the SQLite database to the disk (is disk full?)";
+      }
+          
       count = 0;
     }