Discriminated outcome for best-effort SDK calls. The success branch
carries the parsed value; the failure branch carries an
ApiRequestError variant the caller can branch on (retry on
network, refresh on unauthorized, surface on validation, etc.)
— distinctions a flat T | null would collapse.
The error type is fixed to ApiRequestError rather than
generic: every call site in the SDK fails through the same
classification pipeline, so a <TError> parameter would be a
degree of freedom nothing exercises.
Type Parameters
T
Type of the parsed value carried by the success branch.
Discriminated outcome for best-effort SDK calls. The success branch carries the parsed value; the failure branch carries an ApiRequestError variant the caller can branch on (retry on
network, refresh onunauthorized, surface onvalidation, etc.) — distinctions a flatT | nullwould collapse.The error type is fixed to ApiRequestError rather than generic: every call site in the SDK fails through the same classification pipeline, so a
<TError>parameter would be a degree of freedom nothing exercises.