Closed SGA-A closed 1 month ago
Was recently addressed in today's commit via item partial matching, but there are still more areas where this is needed.
For now, we had to place one of our transformers inside the cogs\economy file path in order to avoid a circular import. The transformer relies on classes that are also only available inside that file path.
Since this is starting to become a major problem, #124 will be receiving a lot of attention over the next couple of weeks/months moving forward.
Also, this is my first time creating custom transformers, so the practises I used to perform the changes in the resolving commit may not be right, in which case look into the documentation for this initial issue comment and also consider looking into the docs for transformers themselves.
There were more instances of this happening then we thought, so we'll begin working on it again.
Will be open indefinitley until I can firmly confirm that there are no more unnecessary instances of this happening.
Updated the original comment to include the known list of these instances occuring to make changes to accordingly.
Generally speaking this is only applicable to helper functions and objects that act as helpers (i.e., transformers).
Remaining instances of this issue to rectify
Unlike transformers for slash commands, converters are used for contexts. See the relevant tutorial and documentation
Is your feature request related to a problem? Please describe. A lot of the time, I've noticed that in checks to ensure a certain criteria is met,
NoneType
is returned or a Falsey value: https://github.com/SGA-A/c2c/blob/eadce1d2aac16ff29fb99a44bb6933b6dcd5b690/cogs/economy.py#L3406-L3408 But now I've understood it shouldn't really be handled this way. Exceptions were designed with this in mind. Describe the solution you'd like A custom error can be created that inherits from either app command errors or text command errors. This custom error can be added with acause
attribute that display's a user friendly error message as to why the error occured.Describe alternatives you've considered Nothing yet
Additional context Relevant documentation: https://docs.python.org/3/tutorial/errors.html#exceptions https://docs.python.org/3/tutorial/errors.html#handling-exceptions https://docs.python.org/3/tutorial/errors.html#raising-exceptions https://docs.python.org/3/tutorial/errors.html#user-defined-exceptions