feat(core): typed Vta/Auth error variants distinct from Config#100
Merged
Conversation
…ures (R18) build_runtime_vta_client mapped VTA DIDComm-session and challenge-response auth failures into the catch-all OpenVTCError::Config, so callers could not tell a retryable VTA/auth fault from genuine config corruption (which warrants a reset). Add OpenVTCError::Vta (connection/session/transport) and OpenVTCError::Auth (challenge-response). Repoint the DIDComm session-open failure to Vta and the challenge_response failure to Auth. The non-VTA-backend and empty-vta_url sites stay Config (genuine config problems). The TUI load path now surfaces 'check VTA / re-auth' guidance for Vta/Auth and reserves reset-style messaging for Config. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task R18 (remediation plan, Phase R3 — structural).
Problem
build_runtime_vta_client(openvtc-core/src/config/mod.rs) mapped VTA session failures and auth failures into the catch-allOpenVTCError::Config(String), so callers couldn't tell a retryable network/auth failure from genuine config corruption (which warrants a reset).Fix
Added two
thiserrorvariants —Vta(String)("VTA Error: {0}", connection/session/transport) andAuth(String)("Auth Error: {0}", challenge-response). Repointed the two runtime-fault sites; left the genuine config problems (non-VTA key backend,REST selected but vta_url empty) asConfig.Caller guidance: the TUI startup path had one catch-all "Couldn't load configuration!" (reset-framing) for any error; added a
Vta(_) | Auth(_)arm printing "Couldn't reach the VTA!" + an actionable hint (re-authenticate / check VTA reachable), reserving the reset/setup path for realConfigerrors.Tests
Variant rendering + a
Vta/Auth≠Config(reset-trigger) invariant. Boundary: live connect/auth paths need a real VTA, so the classification is tested at the variant level. Gate:fmt/clippy -D warnings/test --workspacegreen (core 142).