-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Inconsisten Time
error handling
#80059
Comments
It doesn't return an error value so this isn't really relevant. Since returning any other value would break compatibility (as it isn't necessarily clear that it is an error) I'd suggest documenting this detail |
I would suggest:
The user would have the option to manage the error with these modifications. |
Would break compatibility
Doesn't work since GDScript can't return by reference, so you can't return the value and the error The current behavior is by design, see #60215, returning |
The function that checks the date wouldn't have to raise any error, just determine if the date is valid. With this, the user can decide if to call other |
That would be the area of a proposal, so please open one for that if you like (make sure you follow all the steps and fill in everything) |
I opened a bug because you can't distinguish between an invalid date and converting to unix 1970-01-01. You can see my proposal here. |
Closing in favour of godotengine/godot-proposals#7414 (comment) as the current behaviour is by design (and would break compatibility) |
Godot version
v4.1.stable.official [9704596]
System information
Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1050 (NVIDIA; 31.0.15.3667) - Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 Threads)
Issue description
Error handling is not well implemented. Try this:
You will get:
Furthermore, in the global scope,
OK = 0
.Conclusion, you can't distinguish between an invalid date and date 1970-01-01.
Steps to reproduce
See "Issue description"
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: