# HG changeset patch # User Alain Mazy # Date 1694008631 -7200 # Node ID 33410f14033b6b7e6d76d97acadd36dc17c3f01e # Parent 746a8a792a74e57379bb5cf0f819ea2156e23c84 new error code ForbiddenAccess diff -r 746a8a792a74 -r 33410f14033b OrthancFramework/Resources/CodeGeneration/ErrorCodes.json --- a/OrthancFramework/Resources/CodeGeneration/ErrorCodes.json Wed Sep 06 13:05:42 2023 +0200 +++ b/OrthancFramework/Resources/CodeGeneration/ErrorCodes.json Wed Sep 06 15:57:11 2023 +0200 @@ -250,6 +250,12 @@ "Name": "MainDicomTagsMultiplyDefined", "Description": "A main DICOM Tag has been defined multiple times for the same resource level" }, + { + "Code": 45, + "HttpStatus": 403, + "Name": "ForbiddenAccess", + "Description": "Access to a resource is forbidden" + }, diff -r 746a8a792a74 -r 33410f14033b OrthancFramework/Sources/Enumerations.cpp --- a/OrthancFramework/Sources/Enumerations.cpp Wed Sep 06 13:05:42 2023 +0200 +++ b/OrthancFramework/Sources/Enumerations.cpp Wed Sep 06 15:57:11 2023 +0200 @@ -199,6 +199,9 @@ case ErrorCode_MainDicomTagsMultiplyDefined: return "A main DICOM Tag has been defined multiple times for the same resource level"; + case ErrorCode_ForbiddenAccess: + return "Access to a resource is forbidden"; + case ErrorCode_SQLiteNotOpened: return "SQLite: The database is not opened"; @@ -2278,6 +2281,9 @@ case ErrorCode_Revision: return HttpStatus_409_Conflict; + case ErrorCode_ForbiddenAccess: + return HttpStatus_403_Forbidden; + case ErrorCode_CreateDicomNotString: return HttpStatus_400_BadRequest; diff -r 746a8a792a74 -r 33410f14033b OrthancFramework/Sources/Enumerations.h --- a/OrthancFramework/Sources/Enumerations.h Wed Sep 06 13:05:42 2023 +0200 +++ b/OrthancFramework/Sources/Enumerations.h Wed Sep 06 15:57:11 2023 +0200 @@ -148,6 +148,7 @@ ErrorCode_DatabaseCannotSerialize = 42 /*!< Database could not serialize access due to concurrent update, the transaction should be retried */, ErrorCode_Revision = 43 /*!< A bad revision number was provided, which might indicate conflict between multiple writers */, ErrorCode_MainDicomTagsMultiplyDefined = 44 /*!< A main DICOM Tag has been defined multiple times for the same resource level */, + ErrorCode_ForbiddenAccess = 45 /*!< Access to a resource is forbidden */, 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 746a8a792a74 -r 33410f14033b OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h --- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Wed Sep 06 13:05:42 2023 +0200 +++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Wed Sep 06 15:57:11 2023 +0200 @@ -245,6 +245,7 @@ OrthancPluginErrorCode_DatabaseCannotSerialize = 42 /*!< Database could not serialize access due to concurrent update, the transaction should be retried */, OrthancPluginErrorCode_Revision = 43 /*!< A bad revision number was provided, which might indicate conflict between multiple writers */, OrthancPluginErrorCode_MainDicomTagsMultiplyDefined = 44 /*!< A main DICOM Tag has been defined multiple times for the same resource level */, + OrthancPluginErrorCode_ForbiddenAccess = 45 /*!< Access to a resource is forbidden */, 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 746a8a792a74 -r 33410f14033b OrthancServer/Sources/main.cpp --- a/OrthancServer/Sources/main.cpp Wed Sep 06 13:05:42 2023 +0200 +++ b/OrthancServer/Sources/main.cpp Wed Sep 06 15:57:11 2023 +0200 @@ -819,6 +819,7 @@ PrintErrorCode(ErrorCode_DatabaseCannotSerialize, "Database could not serialize access due to concurrent update, the transaction should be retried"); PrintErrorCode(ErrorCode_Revision, "A bad revision number was provided, which might indicate conflict between multiple writers"); PrintErrorCode(ErrorCode_MainDicomTagsMultiplyDefined, "A main DICOM Tag has been defined multiple times for the same resource level"); + PrintErrorCode(ErrorCode_ForbiddenAccess, "Access to a resource is forbidden"); 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");