-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error handling #41
Comments
We use a structure like this internally:
Turning checks into readable sentences improves devx, and ui rendering consistency. |
We need better error handling, we can't tell why things fail. See w3c-ccg/vp-request-spec#12 We need 400 errors with more information... and 200 errors with more information.... we need better schemas for communicating failure and success of flows. |
This is between the presenting parties: define happy path and sad path interactions. What are the 400 error we expect can occur? What are relevant error messages which will help resovle? |
I might pick this up next time when I have better bandwidth. |
awaiting w3c-ccg/vc-api#258 |
next step: port over VC API error schemas, add postman for testing |
Need to port over the schemas and write postman tests that produce errors for all documented error cases. |
We still need to port over some error examples, ideally covering verify errors such as revocation. |
Necessary for addressing this:
|
Use english language to describe error cases, then ensure that there is a postman collection that asserts the json structure for each error condition. |
Initial Error cases when issuing a credential: requests:
responses:
|
We have a generic error response today:
IMO, its a best practice to make a table with error codes for each case, and publish detailed objects along with the code optionally... in higher security environments you just drop the details. Here are some of the errors listed above, in yaml format:
|
Before we go further, an entire category of '400' errors is solved for by:
For example:
Where I propose we solve for these kinds of errors consistnetly... a very common pattern looks like this: (req, res)=>{
try {
requireValidJSONSchema(req.body, IssueCredentialRequestBody)
} catch (e){
res.400.send(message: e.message) // JSON-Schema errors
}
try {
issue(req.body)
} catch (e){
res.400.send(message: e.message) // JSON-LD errors
} |
I assigned |
I think this is blocked by having a negative test suite, and interesting jsons that produce 4xx errors when sent to the apis. |
Self-assigning to begin work on negative test suite. |
I think that having specific error messages can drift easily, but I agree with @OR13 that a test suite is the logical step for addressing these details. |
@brownoxford has some stuff he'll PR to indicate direction on this. |
Draft PR #253 is where this will be added |
I propose that we define generic values for the |
Conformance test suite is implementing the negative tests with mutated JSON to produce 4xx errors, and BadRequest.yml, Unauthenticated.yml, and Unauthorized.yml have been updated to specify response code and message (leaving description up to implementor). Can we close this issue? |
Conformance tests will take this over. Closing. |
When errors occur, there should be helpful messages returned over http.
There should be an error message structure.
The structure should be used when handling 200 responses where the verification failed
There should also be a 400 error message structure, for cases where the client violates the api definition.
There should be test cases for errors, and each variant of an error.
There should be specific cases for revocation, expiration, preactivation.
The text was updated successfully, but these errors were encountered: