-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Standardize error messages in TLuaInterpreter.cpp #2091
Comments
Other error messages do not talk about wrong type, but wrong value. Example for best practise yet: "setBackgroundColor: bad argument #%d value (red value needs to be between 0-255, got %d)" Suggestion along lines of above: "(Optional) Argument #%d (red value) has unexpected value! Expected value needs to be between 0-255, got %d" |
Actually the wrong value cases (colloquially, or at least by me, called run-time errors because the supplied arguments are of the right type but not the right values to produce valid results) are already starting to be redone and moving away from the example quoted in the last post. They:
With regard to the initial issue report I would note that the use of the phrase |
Here follows an inventory of TLuaInterpreter's public functions Position in following groups indicate whether error messages are (somewhat) standardized: ✅ These functions have been fixed now(to be filled from below) ⚡ Error messages to be standardized indeed Source-code needs to be edited, messages need to be improved. Afterwards, move to above "fixed" section and/or set check-mark
✅ These functions were already standardizing messages alright
✅ Internal functions - unknown to users
✅ Functions without arguments - fine already! 😄
|
Verification is not yet complete, but already found 65 functions needing work. ⚡
Not sure if this refactorization can be done prior or is out of scope here. |
While there is still ongoing work internally to streamline and standardize text creation, this issue is mostly done. The players only see the "wrong argument type" style error message in setPopup() and no other function anymore. As explained in #4599 (comment) there are differences in code and wiki documentation still |
I will mark this as done. The only function remaining (setPopup) is discussed in a seperate issue #4641 still. Meanwhile we established the requested helper functions and gave meaningful type errors and value errors to all c++ functions. Checked Lua functions, too. Not all of them check all their arguments already, but if they do, they give informative error messages. |
Brief summary of issue / Description of requested feature:
Some (but not all) functions give basic information on failure, for example: which argument is not as expected (if there are multiple arguments) and what would have been expected instead. This should be expanded as best practise for all functions.
Reasons for adding feature:
Expected result of feature
A good practise seems to consist of following elemets:
Ideas for how to solve / implement:
The text was updated successfully, but these errors were encountered: