changeset 4903:260377d84e9f proto-filter-instance-returning-error-code

integration mainline->proto-filter-instance-returning-error-code
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 20 Feb 2022 17:04:41 +0100
parents 3ab57510f6dd (diff) df86d2505df8 (current diff)
children
files
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/main.cpp	Sun Feb 20 16:57:43 2022 +0100
+++ b/OrthancServer/Sources/main.cpp	Sun Feb 20 17:04:41 2022 +0100
@@ -87,10 +87,18 @@
 
       std::string id;
       ServerContext::StoreResult result = context_.Store(id, *toStore, StoreInstanceMode_Default);
-      return result.GetCStoreStatusCode();
+
+      if (result.GetStatus() == StoreStatus_FilteredOut)
+      {
+        return STATUS_STORE_Refused_OutOfResources;  // C-Store "Out of Resources" error code (0xa700)
+      }
+      else
+      {
+        return result.GetCStoreStatusCode();
+      }
     }
 
-    return STATUS_STORE_Error_CannotUnderstand;
+    return STATUS_STORE_Error_CannotUnderstand;  // C-Store "Cannot understand" error code (0xc000)
   }
 };