Classify validation failures into specific exception types#515
Open
marcoscaceres wants to merge 4 commits into
Open
Classify validation failures into specific exception types#515marcoscaceres wants to merge 4 commits into
marcoscaceres wants to merge 4 commits into
Conversation
Replaces "throw an appropriate exception" in `Validate credential requests` with a switch that maps each class of validation failure to a concrete exception type, mirroring the platform-error switch in `Initiate the credential request`: - Malformed/invalid request data → `TypeError` - Otherwise → `"OperationError"` `DOMException` Also clarifies the accompanying prose to separate what counts as a validation failure (protocol-specific) from how such a failure is classified into an exception type (in-scope). Closes #472 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mohamedamir
approved these changes
May 14, 2026
mohamedamir
left a comment
Collaborator
There was a problem hiding this comment.
@marcoscaceres as per our discussion, LGTM
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.
Closes #472.
Replaces "throw an appropriate exception" in
Validate credential requestswith a switch that maps each class of validation failure to a concrete exception type, matching the style of the platform-error switch inInitiate the credential request:TypeError"OperationError"DOMExceptionAlso clarifies the accompanying prose to separate what counts as a validation failure (protocol-specific) from how such a failure is classified into an exception type (in-scope).
Without this, implementations have no shared rule and WPT can only assert "some exception."
cc @w3c-fedid/dc-editors
The following tasks have been completed:
Implementation commitment:
Documentation and checks
Preview | Diff