nuts-foundation / nuts-foundation/nuts-node

PEX: Inconsistent error/return values depending on which requirements aren't met

Open
#2,599 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
28
Forks
23
Avg merge
1d 10h
Merged PRs (30d)
76

Description

PresentationDefinition.Match() returns:

  • no error and no VCs when InputDescriptor constraints aren't met
  • an error when submission requirements aren't met (e.g.: Presentation Definition with 2 InputDescriptors, 1 for JSON-LD, 1 for JWT, pick 1)

Both situations are functionally valid flows, and should not yield a (hard) error. But the caller might still want to have details on what failed to match (e.g. format). Maybe we should return a special error type for matching failures (not errors, e.g. invalid definition), which can be tested with errors.As (or Is), which also contains detailed information?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PresentationDefinition.Match() and compare its behavior when InputDescriptor constraints fail with behavior when submission requirements fail. Done should mean both valid non-matches avoid a hard error while still exposing enough failure detail for callers to inspect.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.