dfinity / wg-identity-authentication

Repository of the Identity and Wallet Standards Working Group
https://wiki.internetcomputer.org/wiki/Identity_%26_Authentication
Apache License 2.0
27 stars 8 forks source link

ICRC25 Error fixes #69

Closed jsamol closed 9 months ago

jsamol commented 9 months ago

This PR fixes the error response definitions to adhere to the JSON-RPC 2.0 standard.

The errors are now identified by their 5-digit codes, where the first digit represents the version of the standard and the second digit defines the error's category. The categories defined for now are:

For example: 13002 suggests that it's an error defined in the version 1 of the standard and falls into the User action category.

jsamol commented 9 months ago
  • Allow 2 digits for the version, otherwise we're quite restricted on the number of iterations we can do.

Ah, good point 😄

Do you have a use-case in mind, where having error versions is important?

Simply that new versions could change the error definitions. Alternatively, we could have "unversioned" errors, mainly Version not supported that needs to be carried in unchanged form throughout any future versions, and implicitly "versioned" errors whose version will be determined based on the matching request.