-
-
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
Improve the get_node()
error message to be more descriptive
#46243
Improve the get_node()
error message to be more descriptive
#46243
Conversation
f4f7f5b
to
01dcc63
Compare
ERR_FAIL_COND_V_MSG( | ||
!node, | ||
nullptr, | ||
vformat(R"(Node not found: "%s" (absolute path attempted from "%s").)", p_path, get_path())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there much point giving this attempted from "%s"
info? An absolute path is an absolute path, it doesn't matter where it originates from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer giving as much context as possible from error messages. While absolute paths behave the same from anywhere, I think the context from the absolute path error message should still remain the same as the relative path error message. Otherwise, this could end up being confusing (an error message being less informative depending of the argument you give to a function).
- Mention the origin of the `get_node()` call. - Mention whether the attempted path is absolute or relative. See godotengine#46214.
01dcc63
to
e6abdc9
Compare
Thanks! |
Cherry-picked for 3.2.4. |
get_node()
call.See #46214.
Test project: test_get_node_error.zip
Preview
Before
After