changeset 4442:f77ee6e6cf47

new error code: ErrorCode_BadRange
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 Jan 2021 14:32:44 +0100
parents 453cd3a5a0da
children fd958175c5b9
files OrthancFramework/Resources/CodeGeneration/ErrorCodes.json OrthancFramework/Sources/Enumerations.cpp OrthancFramework/Sources/Enumerations.h OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h OrthancServer/Sources/main.cpp
diffstat 5 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/CodeGeneration/ErrorCodes.json	Sat Jan 09 13:13:06 2021 +0100
+++ b/OrthancFramework/Resources/CodeGeneration/ErrorCodes.json	Mon Jan 11 14:32:44 2021 +0100
@@ -227,6 +227,12 @@
     "Name": "DiscontinuedAbi", 
     "Description": "Calling a function that has been removed from the Orthanc Framework"
   }, 
+  {
+    "Code": 41, 
+    "HttpStatus" : 416,
+    "Name": "BadRange",
+    "Description": "Incorrect range request"
+  }, 
 
 
 
--- a/OrthancFramework/Sources/Enumerations.cpp	Sat Jan 09 13:13:06 2021 +0100
+++ b/OrthancFramework/Sources/Enumerations.cpp	Mon Jan 11 14:32:44 2021 +0100
@@ -184,6 +184,9 @@
       case ErrorCode_DiscontinuedAbi:
         return "Calling a function that has been removed from the Orthanc Framework";
 
+      case ErrorCode_BadRange:
+        return "Incorrect range request";
+
       case ErrorCode_SQLiteNotOpened:
         return "SQLite: The database is not opened";
 
@@ -2169,6 +2172,9 @@
       case ErrorCode_DatabaseUnavailable:
         return HttpStatus_503_ServiceUnavailable;
 
+      case ErrorCode_BadRange:
+        return HttpStatus_416_RequestedRangeNotSatisfiable;
+
       case ErrorCode_CreateDicomNotString:
         return HttpStatus_400_BadRequest;
 
--- a/OrthancFramework/Sources/Enumerations.h	Sat Jan 09 13:13:06 2021 +0100
+++ b/OrthancFramework/Sources/Enumerations.h	Mon Jan 11 14:32:44 2021 +0100
@@ -133,6 +133,7 @@
     ErrorCode_BadGeometry = 38    /*!< Geometry error encountered in Stone */,
     ErrorCode_SslInitialization = 39    /*!< Cannot initialize SSL encryption, check out your certificates */,
     ErrorCode_DiscontinuedAbi = 40    /*!< Calling a function that has been removed from the Orthanc Framework */,
+    ErrorCode_BadRange = 41    /*!< Incorrect range request */,
     ErrorCode_SQLiteNotOpened = 1000    /*!< SQLite: The database is not opened */,
     ErrorCode_SQLiteAlreadyOpened = 1001    /*!< SQLite: Connection is already open */,
     ErrorCode_SQLiteCannotOpen = 1002    /*!< SQLite: Unable to open the database */,
--- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Sat Jan 09 13:13:06 2021 +0100
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Mon Jan 11 14:32:44 2021 +0100
@@ -238,6 +238,7 @@
     OrthancPluginErrorCode_BadGeometry = 38    /*!< Geometry error encountered in Stone */,
     OrthancPluginErrorCode_SslInitialization = 39    /*!< Cannot initialize SSL encryption, check out your certificates */,
     OrthancPluginErrorCode_DiscontinuedAbi = 40    /*!< Calling a function that has been removed from the Orthanc Framework */,
+    OrthancPluginErrorCode_BadRange = 41    /*!< Incorrect range request */,
     OrthancPluginErrorCode_SQLiteNotOpened = 1000    /*!< SQLite: The database is not opened */,
     OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001    /*!< SQLite: Connection is already open */,
     OrthancPluginErrorCode_SQLiteCannotOpen = 1002    /*!< SQLite: Unable to open the database */,
--- a/OrthancServer/Sources/main.cpp	Sat Jan 09 13:13:06 2021 +0100
+++ b/OrthancServer/Sources/main.cpp	Mon Jan 11 14:32:44 2021 +0100
@@ -772,6 +772,7 @@
     PrintErrorCode(ErrorCode_BadGeometry, "Geometry error encountered in Stone");
     PrintErrorCode(ErrorCode_SslInitialization, "Cannot initialize SSL encryption, check out your certificates");
     PrintErrorCode(ErrorCode_DiscontinuedAbi, "Calling a function that has been removed from the Orthanc Framework");
+    PrintErrorCode(ErrorCode_BadRange, "Incorrect range request");
     PrintErrorCode(ErrorCode_SQLiteNotOpened, "SQLite: The database is not opened");
     PrintErrorCode(ErrorCode_SQLiteAlreadyOpened, "SQLite: Connection is already open");
     PrintErrorCode(ErrorCode_SQLiteCannotOpen, "SQLite: Unable to open the database");