-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
We shall improve the error response at once, currently, there are several problems:
nameis type of error which is confusing.codeis just HTTP status code, which doesn't have to be in JSON response.infodoesn't have standardized fields or documentation.
So instead of:
"error": {
"name": "Invalid",
"reason": "InvariantViolated",
"message": "identity already exists",
"code": 400,
"info": {
"cause": {
"kind": "DuplicatedIdentity"
}
}
}
We shall change to:
"error": {
"type": "TypeOfError"
"code": "Short String for the Error"
"message": "Human readable message"
"info": { }
}
The main changes from the current design are:
- Use
typeinstead ofnamefor the category of error. Usingnameastypeis very confusing. We also should have a list oftypepossible values. - HTTP status code should go back to HTTP response header
codeandmessageare the actual error- We shall study the APIs used this error scheme, and try to come up with a standardized object for
info, otherwise it is not usable at all (or else we need to write a spec to indicate what error will have whichinfo, but it is not as good as a standardized object.
Original rename suggested by Louis
- DuplicatedIdentity becomes its own error
- IdentityModifyDisabled becomes its own error
- NoAuthenticator becomes its own error
- MismatchedUser becomes its own error
- Keep ErrClaimNotVerifiable unchanged.
Metadata
Metadata
Assignees
Labels
No labels