You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## fixes KILTProtocol/ticket#2290
This harmonizes the instance names in the Error enums of our pallets.
Before this change the names were kind of randomly choosen, so we had
for example CTypeNotFound and DidNotPresent. Those names were bad for
thwo reasons:
1) They mean the same thing but use different wording
2) They contain the module name
After this change both instances would be named NotFound.
All the other changes are something along those lines.
Co-authored-by: Albrecht <albrecht@kilt.io>
1) Use capitalized camel case in the variant names. For example, instead of using "NOT_FOUND" you should use "NotFound".
4
+
5
+
2) Avoid using the word "error" as a suffix for the variant names. For example, instead of using "NotFoundError" you should use "NotFound". It's clear from the caller's context that this is an error.
6
+
7
+
3) Avoid using the pallet name in the variant names. For example instead of "Web3NameNotFound" you should use "NotFound".
8
+
9
+
4) Try to take words from the vocabulary already defined in the code base. For example instead of introducing a new variant "NotExisting" you should use, once again, "NotFound". Common vocabulary includes: NotFound, NotAuthorized, AlreadyExists, MaxXYZExceeded.
10
+
11
+
5) Use descriptive and concise names for the variants. Avoid using abbreviations or acronyms unless they are widely recognized and understood by other developers who may be working on the codebase.
0 commit comments