Skip to content

title: sgns::PriceFetchFailure summary: Struct error carrier: a code plus the HTTP status that produced it, so tests and logs assert the numeric status without string-matching.


sgns::PriceFetchFailure

Struct error carrier: a code plus the HTTP status that produced it, so tests and logs assert the numeric status without string-matching. More...

#include <PriceFetchError.hpp>

Public Functions

Name
std::string Message() const
Human-readable failure text; embeds the numeric status when one exists. The facade logs this verbatim (criterion 1: the log contains the literal "403"/"429").

Public Attributes

Name
PriceFetchError code
unsigned httpStatus
std::optional< http::ClientError > transportError
Transport classification when code == NetworkError (D-14); nullopt = unclassified.

Detailed Description

struct sgns::PriceFetchFailure;

Struct error carrier: a code plus the HTTP status that produced it, so tests and logs assert the numeric status without string-matching.

httpStatus == 0 means no HTTP response was received at all (pure transport failure).

Existing two-field braced initializers ({code, status}) keep compiling — transportError is a defaulted member (aggregate init).

Public Functions Documentation

function Message

inline std::string Message() const

Human-readable failure text; embeds the numeric status when one exists. The facade logs this verbatim (criterion 1: the log contains the literal "403"/"429").

Public Attributes Documentation

variable code

PriceFetchError code = PriceFetchError::NetworkError;

variable httpStatus

unsigned httpStatus = 0;

variable transportError

std::optional< http::ClientError > transportError;

Transport classification when code == NetworkError (D-14); nullopt = unclassified.


Updated on 2026-10-09 at 04:02:48 +0000