Skip to content
Snippets Groups Projects
Verified Commit d1525b52 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

DOC: Some minor notes for developers in the transaction_status

parent d777d5c2
No related branches found
No related tags found
1 merge request!3Better Error Handling and Logging
Pipeline #11054 passed
Pipeline: caosdb-cppinttest

#11056

    This commit is part of merge request !3. Comments created here will be created in the context of that merge request.
    ...@@ -48,6 +48,8 @@ using caosdb::exceptions::TransactionError; ...@@ -48,6 +48,8 @@ using caosdb::exceptions::TransactionError;
    */ */
    class TransactionStatus { class TransactionStatus {
    public: 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 & { inline static auto INITIAL() -> const TransactionStatus & {
    static const TransactionStatus initial( static const TransactionStatus initial(
    StatusCode::INITIAL, caosdb::get_status_description(StatusCode::INITIAL)); StatusCode::INITIAL, caosdb::get_status_description(StatusCode::INITIAL));
    ...@@ -66,6 +68,9 @@ public: ...@@ -66,6 +68,9 @@ public:
    } }
    inline static auto RPC_ERROR(const std::string &details) inline static auto RPC_ERROR(const std::string &details)
    -> const TransactionStatus { -> 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( return TransactionStatus(
    StatusCode::GENERIC_RPC_ERROR, StatusCode::GENERIC_RPC_ERROR,
    caosdb::get_status_description(StatusCode::GENERIC_RPC_ERROR) + caosdb::get_status_description(StatusCode::GENERIC_RPC_ERROR) +
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment