From d1525b5273ef596812636addaedea3cadc1b7b5f Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Mon, 2 Aug 2021 10:16:46 +0200 Subject: [PATCH] DOC: Some minor notes for developers in the transaction_status --- include/caosdb/transaction_status.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/caosdb/transaction_status.h b/include/caosdb/transaction_status.h index 6c5b7a6..8e54c8b 100644 --- a/include/caosdb/transaction_status.h +++ b/include/caosdb/transaction_status.h @@ -48,6 +48,8 @@ using caosdb::exceptions::TransactionError; */ class TransactionStatus { public: + // REFACTORING NEEDED: When you touch this code again consider writing a + // macro, because this is a lot of redundant code here... inline static auto INITIAL() -> const TransactionStatus & { static const TransactionStatus initial( StatusCode::INITIAL, caosdb::get_status_description(StatusCode::INITIAL)); @@ -66,6 +68,9 @@ public: } inline static auto RPC_ERROR(const std::string &details) -> const TransactionStatus { + // We use the GENERIC_RPC_ERROR here because we might want to add further + // RPC_ERROR states with different error codes (which stem from GRPC) here + // in the future. return TransactionStatus( StatusCode::GENERIC_RPC_ERROR, caosdb::get_status_description(StatusCode::GENERIC_RPC_ERROR) + -- GitLab