|
Lightweight 0.20261105.1
|
Verdict of a non-throwing checked driver call, carrying the diagnostic that justifies a failure verdict whenever that failure was injected rather than real. More...
#include <Concept.hpp>
Public Member Functions | |
| constexpr | operator bool () const noexcept |
| template<typename ReadFromHandle > requires std::is_invocable_r_v<SqlErrorInfo, ReadFromHandle const&> | |
| SqlErrorInfo | EffectiveError (ReadFromHandle const &readFromHandle) const |
| The diagnostic describing this failure, from whichever source actually has one. | |
Public Attributes | |
| bool | succeeded {} |
| Whether the checked call should be treated as having succeeded. | |
| std::optional< SqlErrorInfo > | injectedError {} |
Verdict of a non-throwing checked driver call, carrying the diagnostic that justifies a failure verdict whenever that failure was injected rather than real.
A bare bool is not enough here. When an installed fault source overrides a real success into a failure, the underlying driver call genuinely succeeded, so the handle holds no diagnostic records at all: a caller that recovers by inspecting the error (rather than merely branching on it) would read an empty or stale diagnostic off the handle and take the wrong recovery arm. Carrying the injected error alongside the verdict is what makes such an arm reachable from a test, which is the whole point of the seam.
Definition at line 75 of file Concept.hpp.
|
inlineexplicitconstexprnoexcept |
if. Definition at line 86 of file Concept.hpp.
References succeeded.
|
inline |
The diagnostic describing this failure, from whichever source actually has one.
| readFromHandle | Invoked only when the failure was not injected, to read the real handle's diagnostic (e.g. Driver::Diagnose or SqlConnection::LastError). Deliberately lazy: reading diagnostics off a handle is a driver round-trip, and there is nothing to read when the failure was injected. |
readFromHandle's result. Definition at line 101 of file Concept.hpp.
References injectedError.
| bool Lightweight::Driver::CallOutcome::succeeded {} |
Whether the checked call should be treated as having succeeded.
Definition at line 78 of file Concept.hpp.
Referenced by Lightweight::Driver::Sqlite3::CheckResult(), Lightweight::Driver::Sqlite3::CheckResult(), and operator bool().
| std::optional<SqlErrorInfo> Lightweight::Driver::CallOutcome::injectedError {} |
The injected diagnostic, engaged only when a fault source turned a real success into a failure. Never engaged for a genuine failure — that one's diagnostic is on the handle, where the caller can read it. Prefer EffectiveError over branching on this directly.
Definition at line 83 of file Concept.hpp.
Referenced by EffectiveError().