Closed sidvishnoi closed 4 months ago
Also, would be helpful to have access to error messages from the resource server
(like Signature validation error: could not find key in list of client keys
in this case)
For this, I merged in a PR in rafiki that adds proper GNAP error objects in the auth server:
We will publish a new version of Rafiki (alpha 14) such that the test wallet can be updated with this new change.
In the meantime, I'll edit the client so it can surface up the proper error (for now, the OpenPaymentsClientError will contain code: string
that will have invalid_client
on those errors).
In my opinion this should be a larger effort to actually add all of the possible error codes to both the AS and the RS specs, so they are obvious to the users of Open Payments :+1: I'll bring it up in the next Open Payments catch up call
Can possibly include in error description until codes are finalized?
Can possibly include in error description until codes are finalized?
In this Open Payments example error:
I'd imagine the corresponding OpenPaymentsClientError
will be as such:
try {
} catch (err) {
err.code // "invalid_client"
err.description // "Could not determine client"
}
Context: Web Monetization extension
If a user revokes key from wallet, all subsequent requests (to auth.rafiki.money in this case) error with
HTTP 400
+invalid_client
. But this code isn't available to client to check whether it's a 400 due toinvalid_client
or some other reason. The response body saysinvalid_client
, but we can't access the body on error.Exposing this (
GNAPErrorCode
in case of auth server) inOpenPaymentsClientError
would help us gracefully handle https://github.com/interledger/web-monetization-extension/issues/332