Skip to content

common/error.cpp

Boost.Outcome error category registration for GNUS NEO SWARM.

Functions

Name
OUTCOME_CPP_DEFINE_CATEGORY_3(sgns::neoswarm , Error , e )

Functions Documentation

function OUTCOME_CPP_DEFINE_CATEGORY_3

OUTCOME_CPP_DEFINE_CATEGORY_3(
    sgns::neoswarm ,
    Error ,
    e 
)

Source code

#include "error.hpp"

OUTCOME_CPP_DEFINE_CATEGORY_3( sgns::neoswarm, Error, e )
{
    using E = sgns::neoswarm::Error;
    switch ( e )
    {
        case E::ModelLoadFailed:
            return "Model load failed";
        case E::InferenceFailed:
            return "Inference failed";
        case E::TokenizerFailed:
            return "Tokenizer failed";
        case E::FP4DecodeFailed:
            return "FP4 decode failed";
        case E::RoutingFailed:
            return "Routing failed";
        case E::NetworkError:
            return "Network error";
        case E::PeerNotFound:
            return "Peer not found";
        case E::BroadcastTimeout:
            return "Broadcast timeout";
        case E::StorageError:
            return "Storage error";
        case E::ReputationNotFound:
            return "Reputation not found";
        case E::KnowledgeUnavailable:
            return "Knowledge unavailable";
        case E::FactValidationFailed:
            return "Fact validation failed";
        case E::IdentityError:
            return "Identity error";
        case E::SignatureInvalid:
            return "Signature invalid";
        case E::InvalidArgument:
            return "Invalid argument";
        case E::NotImplemented:
            return "Not implemented";
        case E::InternalError:
            return "Internal error";
    }
    return "Unknown error";
}

Updated on 2026-07-25 at 22:56:57 +0000