diff OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp @ 2624:714dcddeb65f jobs

asynchronous c-movoe
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 May 2018 21:44:22 +0200
parents 988936118354
children c691fcf66071
line wrap: on
line diff
--- a/OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp	Wed May 23 14:28:25 2018 +0200
+++ b/OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp	Thu May 24 21:44:22 2018 +0200
@@ -52,7 +52,15 @@
     LOG(INFO) << "Sending instance " << instance << " to peer \"" 
               << peer_.GetUrl() << "\"";
 
-    context_.ReadDicom(client_->GetBody(), instance);
+    try
+    {
+      context_.ReadDicom(client_->GetBody(), instance);
+    }
+    catch (OrthancException& e)
+    {
+      LOG(WARNING) << "An instance was removed after the job was issued: " << instance;
+      return false;
+    }
 
     std::string answer;
     if (client_->Apply(answer))
@@ -90,7 +98,8 @@
     Json::Value v;
     peer_.ToJson(v);
     value["Peer"] = v;
-        
+
+    value["Description"] = GetDescription();
     value["InstancesCount"] = static_cast<uint32_t>(GetInstances().size());
     value["FailedInstancesCount"] = static_cast<uint32_t>(GetFailedInstances().size());
   }