Skip to content

uriSchemePresentment: the verifier's error response body is discarded by a bare check(...) #1949

Description

@mc1100

Version: observed on 0.99.0; re-checked against main @ 145e9e1a — unchanged.

What happens

When a verifier rejects a presentation response, uriSchemePresentment asserts the status with a bare check(...) and drops the body:

check(postResponseResponse.status == HttpStatusCode.OK)

The wallet therefore receives:

IllegalStateException: Check failed.

The verifier's actual explanation — the only thing that tells a user or a developer why the presentation was refused — is never read. Because check(...) without a message produces a fixed string, the app cannot distinguish this failure from any other check in the same function either.

Suggested fix

Read the response body and include it, along with the status code, in the thrown exception — the same shape as the neighbouring reader-side checks at L268-L269, which do report the status. A dedicated exception type carrying status + body would be better still, since a wallet usually wants to show the verifier's message rather than a stack trace.

Related

Workaround we ship

Our presenter string-matches "Check failed." and substitutes a readable sentence. Matching on an exception message is exactly as fragile as it sounds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions