changeset 2132:a43708636890

ErrorCode_NotEnoughMemory and ErrorCode_NullPointer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 10:19:53 +0100
parents bb199bccdc45
children 15ae532af70e
files Core/Enumerations.cpp Core/Enumerations.h OrthancServer/main.cpp Plugins/Include/orthanc/OrthancCPlugin.h Resources/ErrorCodes.json
diffstat 5 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Enumerations.cpp	Tue Nov 08 10:49:45 2016 +0100
+++ b/Core/Enumerations.cpp	Wed Nov 09 10:19:53 2016 +0100
@@ -156,6 +156,12 @@
       case ErrorCode_NotAcceptable:
         return "Cannot send a response which is acceptable according to the Accept HTTP header";
 
+      case ErrorCode_NotEnoughMemory:
+        return "The server hosting Orthanc is running out of memory";
+
+      case ErrorCode_NullPointer:
+        return "Cannot handle a NULL pointer";
+
       case ErrorCode_SQLiteNotOpened:
         return "SQLite: The database is not opened";
 
--- a/Core/Enumerations.h	Tue Nov 08 10:49:45 2016 +0100
+++ b/Core/Enumerations.h	Wed Nov 09 10:19:53 2016 +0100
@@ -83,6 +83,8 @@
     ErrorCode_StorageAreaPlugin = 32    /*!< Error in the plugin implementing a custom storage area */,
     ErrorCode_EmptyRequest = 33    /*!< The request is empty */,
     ErrorCode_NotAcceptable = 34    /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
+    ErrorCode_NotEnoughMemory = 35    /*!< The server hosting Orthanc is running out of memory */,
+    ErrorCode_NullPointer = 36    /*!< Cannot handle a NULL pointer */,
     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/main.cpp	Tue Nov 08 10:49:45 2016 +0100
+++ b/OrthancServer/main.cpp	Wed Nov 09 10:19:53 2016 +0100
@@ -535,6 +535,8 @@
     PrintErrorCode(ErrorCode_StorageAreaPlugin, "Error in the plugin implementing a custom storage area");
     PrintErrorCode(ErrorCode_EmptyRequest, "The request is empty");
     PrintErrorCode(ErrorCode_NotAcceptable, "Cannot send a response which is acceptable according to the Accept HTTP header");
+    PrintErrorCode(ErrorCode_NotEnoughMemory, "The server hosting Orthanc is running out of memory");
+    PrintErrorCode(ErrorCode_NullPointer, "Cannot handle a NULL pointer");
     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");
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Nov 08 10:49:45 2016 +0100
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Wed Nov 09 10:19:53 2016 +0100
@@ -222,6 +222,8 @@
     OrthancPluginErrorCode_StorageAreaPlugin = 32    /*!< Error in the plugin implementing a custom storage area */,
     OrthancPluginErrorCode_EmptyRequest = 33    /*!< The request is empty */,
     OrthancPluginErrorCode_NotAcceptable = 34    /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
+    OrthancPluginErrorCode_NotEnoughMemory = 35    /*!< The server hosting Orthanc is running out of memory */,
+    OrthancPluginErrorCode_NullPointer = 36    /*!< Cannot handle a NULL pointer */,
     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/Resources/ErrorCodes.json	Tue Nov 08 10:49:45 2016 +0100
+++ b/Resources/ErrorCodes.json	Wed Nov 09 10:19:53 2016 +0100
@@ -195,6 +195,16 @@
     "HttpStatus": 406, 
     "Name": "NotAcceptable", 
     "Description": "Cannot send a response which is acceptable according to the Accept HTTP header"
+  }, 
+  {
+    "Code": 35, 
+    "Name": "NotEnoughMemory", 
+    "Description": "The server hosting Orthanc is running out of memory"
+  }, 
+  {
+    "Code": 36, 
+    "Name": "NullPointer", 
+    "Description": "Cannot handle a NULL pointer"
   },