# HG changeset patch # User Sebastien Jodogne # Date 1520434007 -3600 # Node ID ad8f30fc28d15f0b243b4127b62c90cd73b48618 # Parent a5196a7d98c62559251a4054f9dc092579c5317e new error code: DatabaseUnavailable diff -r a5196a7d98c6 -r ad8f30fc28d1 Core/Enumerations.cpp --- a/Core/Enumerations.cpp Tue Mar 06 10:41:05 2018 +0100 +++ b/Core/Enumerations.cpp Wed Mar 07 15:46:47 2018 +0100 @@ -161,6 +161,9 @@ case ErrorCode_NullPointer: return "Cannot handle a NULL pointer"; + case ErrorCode_DatabaseUnavailable: + return "The database is currently not available (probably a transient situation)"; + case ErrorCode_SQLiteNotOpened: return "SQLite: The database is not opened"; @@ -1617,6 +1620,9 @@ case ErrorCode_NotAcceptable: return HttpStatus_406_NotAcceptable; + case ErrorCode_DatabaseUnavailable: + return HttpStatus_503_ServiceUnavailable; + default: return HttpStatus_500_InternalServerError; } diff -r a5196a7d98c6 -r ad8f30fc28d1 Core/Enumerations.h --- a/Core/Enumerations.h Tue Mar 06 10:41:05 2018 +0100 +++ b/Core/Enumerations.h Wed Mar 07 15:46:47 2018 +0100 @@ -85,6 +85,7 @@ ErrorCode_EmptyRequest = 33 /*!< The request is empty */, ErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */, ErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */, + ErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */, 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 */, diff -r a5196a7d98c6 -r ad8f30fc28d1 NEWS --- a/NEWS Tue Mar 06 10:41:05 2018 +0100 +++ b/NEWS Wed Mar 07 15:46:47 2018 +0100 @@ -18,6 +18,11 @@ * New CMake option: "-DENABLE_LUA_MODULES=ON" to enable support for loading external Lua modules if the Lua engine is statically linked +Plugins +------- + +* New error code: DatabaseUnavailable + Maintenance ----------- diff -r a5196a7d98c6 -r ad8f30fc28d1 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Tue Mar 06 10:41:05 2018 +0100 +++ b/OrthancServer/main.cpp Wed Mar 07 15:46:47 2018 +0100 @@ -573,6 +573,7 @@ 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_NullPointer, "Cannot handle a NULL pointer"); + PrintErrorCode(ErrorCode_DatabaseUnavailable, "The database is currently not available (probably a transient situation)"); 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"); diff -r a5196a7d98c6 -r ad8f30fc28d1 Plugins/Include/orthanc/OrthancCPlugin.h --- a/Plugins/Include/orthanc/OrthancCPlugin.h Tue Mar 06 10:41:05 2018 +0100 +++ b/Plugins/Include/orthanc/OrthancCPlugin.h Wed Mar 07 15:46:47 2018 +0100 @@ -118,7 +118,7 @@ #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 3 -#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 1 +#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 2 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) @@ -234,6 +234,7 @@ OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */, OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */, OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */, + OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */, 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 */, diff -r a5196a7d98c6 -r ad8f30fc28d1 Resources/ErrorCodes.json --- a/Resources/ErrorCodes.json Tue Mar 06 10:41:05 2018 +0100 +++ b/Resources/ErrorCodes.json Wed Mar 07 15:46:47 2018 +0100 @@ -201,6 +201,12 @@ "Name": "NullPointer", "Description": "Cannot handle a NULL pointer" }, + { + "Code": 36, + "HttpStatus": 503, + "Name": "DatabaseUnavailable", + "Description": "The database is currently not available (probably a transient situation)" + },