What
45 throw std:: statements remain in 11 files across the network_system. The facade layer is the worst offender:
tcp_facade.cpp — 12 throws
quic_facade.cpp — 8 throws
udp_facade.cpp — 5 throws
websocket_facade.cpp — 3 throws
http_facade.cpp — 2 throws
The ecosystem convention is Result<T> (from common_system), and the core/internal layers already use it. This creates a mixed error-handling contract.
Why
Callers cannot use a uniform error-handling pattern. Functions that throw require try/catch while adjacent functions return Result<T>.
How
Technical Approach
- Change facade return types from raw
shared_ptr to common::Result<shared_ptr<...>>
- Replace
throw std::invalid_argument(...) with return Result::err(...)
- Update corresponding
.h headers with new signatures
- Update test assertions
Acceptance Criteria
What
45
throw std::statements remain in 11 files across the network_system. The facade layer is the worst offender:tcp_facade.cpp— 12 throwsquic_facade.cpp— 8 throwsudp_facade.cpp— 5 throwswebsocket_facade.cpp— 3 throwshttp_facade.cpp— 2 throwsThe ecosystem convention is
Result<T>(from common_system), and the core/internal layers already use it. This creates a mixed error-handling contract.Why
Callers cannot use a uniform error-handling pattern. Functions that throw require try/catch while adjacent functions return
Result<T>.How
Technical Approach
shared_ptrtocommon::Result<shared_ptr<...>>throw std::invalid_argument(...)withreturn Result::err(...).hheaders with new signaturesAcceptance Criteria
Result<T>instead of throwing