From 9fc9e6264128ff803f3577eafdfcd298fb56eb9e Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Wed, 1 Sep 2021 00:32:38 +0200 Subject: [PATCH] WIP: add message code (for deletion and integer overflow) --- include/caosdb/message_code.h | 15 ++++++++++++--- proto | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/caosdb/message_code.h b/include/caosdb/message_code.h index 367b5e9..faf04d3 100644 --- a/include/caosdb/message_code.h +++ b/include/caosdb/message_code.h @@ -44,13 +44,22 @@ enum MessageCode { ENTITY_DOES_NOT_EXIST = caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_ENTITY_DOES_NOT_EXIST, ENTITY_HAS_NO_PROPERTIES = caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_ENTITY_HAS_NO_PROPERTIES, + INTEGER_VALUE_OUT_OF_RANGE = + caosdb::entity::v1alpha1::MessageCode::MESSAGE_CODE_INTEGER_VALUE_OUT_OF_RANGE, + ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY = + MessageCode::MESSAGE_CODE_ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY, }; [[nodiscard]] inline auto get_message_code(int code) noexcept -> MessageCode { // TODO(tf) smarter, less forgot-it-prone implementation - static MessageCode all_codes[] = {MessageCode::UNSPECIFIED, MessageCode::UNKNOWN, - MessageCode::ENTITY_DOES_NOT_EXIST, - MessageCode::ENTITY_HAS_NO_PROPERTIES}; + static MessageCode all_codes[] = { + MessageCode::UNSPECIFIED, + MessageCode::UNKNOWN, + MessageCode::ENTITY_DOES_NOT_EXIST, + MessageCode::ENTITY_HAS_NO_PROPERTIES, + MessageCode::INTEGER_VALUE_OUT_OF_RANGE, + MessageCode::ENTITY_HAS_BEEN_DELETED_SUCCESSFULLY, + }; for (MessageCode known_code : all_codes) { if (known_code == code) { diff --git a/proto b/proto index 014096e..75e826b 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 014096e3c9d6d4624dc786f5aaec27f26e01072a +Subproject commit 75e826bd318c39e63d324f71e035f08355ffc51f -- GitLab