Struct ErrorInfo

Struct Documentation

struct ErrorInfo

Transport-neutral error descriptor used by the SOVD provider interfaces.

Returned as the error branch of tl::expected<T, ErrorInfo> by provider methods (Data, Operation, Fault, DataStream, Log). The handler layer translates this into a SOVD-compliant GenericError response.

Contract

  • http_status must be in the SOVD error range (400-599). The handler layer clamps out-of-range values and logs a warning.

  • code is the SOVD error code constant (see error_codes.hpp) or a vendor-specific x-medkit-* code.

  • params is an optional JSON object with structured diagnostic parameters. Must be serializable and must not contain sensitive information.

Thread safety

Plain value type; safe to copy and move across threads without synchronization.

Public Members

std::string code

SOVD error code (e.g. ERR_RESOURCE_NOT_FOUND, ERR_X_MEDKIT_ROS2_TOPIC_UNAVAILABLE)

std::string message

Human-readable message (truncated to 512 chars by handlers)

int http_status = {500}

HTTP status in SOVD range 400-599.

nlohmann::json params = nlohmann::json::object()

Optional structured parameters.