godot: [TRACKER] Error macros with cryptic messages due to not having proper custom messages defined
If you stumble upon difficult-to-understand error messages (regardless of your skill level with Godot), please report them here. In your comment, make sure to state:
- Your operating system and Godot version.
- What you were doing when you got the error message. Always include code samples!
- Ideally, a minimal reproduction project that returns the error message.
Note that this issue isn’t about reporting bugs, but reporting cryptic error messages. This issue is about improving error messages so users can figure things out by themselves more easily. If you stumble upon a bug, please open a dedicated issue instead of commenting in this tracker issue.
See https://github.com/godotengine/godot/issues/24199 for background.
Issues
- https://github.com/godotengine/godot/issues/42948
- https://github.com/godotengine/godot/issues/42959 (https://github.com/godotengine/godot/pull/43076)
- https://github.com/godotengine/godot/issues/50382
- https://github.com/godotengine/godot/issues/42719#issuecomment-886217688
- https://github.com/godotengine/godot/issues/60602
- https://github.com/godotengine/godot/issues/62712
- https://github.com/godotengine/godot/issues/94705
- https://github.com/godotengine/godot/issues/97708
For contributors
Even if you’re a beginner in C++, you should be able to add error macros.
To add error explanations to existing errors, search for their origin in the source code (by reading the automatically-generated error message), suffix the error macro with _MSG and add a parameter with a custom message at the end.
We recommend adding context (such as provided arguments versus expected ones) whenever possible. Some examples:
# Best, do this whenever possible:
"Can't listen server on port 420000. The port number must be between 1 and 65535."
# OK:
"Can't listen server on port 420000."
# Bad, this doesn't give much context:
"Can't listen server."
Here are some real-world examples of improving error explanations: https://github.com/godotengine/godot/pull/41352/files, https://github.com/godotengine/godot/pull/35862/files
See Error macros in the documentation for more information.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 12
- Comments: 57 (23 by maintainers)
Commits related to this issue
- Tweak shader errors for features only usable in GLES3 See https://github.com/godotengine/godot/issues/42719#issuecomment-792168504. — committed to Calinou/godot by Calinou 6 years ago
- Tweak shader errors for features only usable in GLES3 See https://github.com/godotengine/godot/issues/42719#issuecomment-792168504. — committed to KoderaSoftwareUnlimited/godot by Calinou 6 years ago
That’s not what the error checks, the node replacing with cannot have a parent, will add it to my PR
No it means trying to set the owner of the node to itself, not its owner, it should have a description though saying that, it’s equivalent to the GDScript
owner = self(this one now has a PR improving the message https://github.com/godotengine/godot/pull/95063)add_child()on a separate thread. Nothing here even hints at that being a potential causation.get_child()on? What script/function called this?I completely understand what’s going wrong, but the error doesn’t lead me to being able to fix anything in it’s current state. Especially since this could be caused by any of the MANY
get_child()or$references in an entire project.This same error essentially happens for
move_child()etcThis appears when saving any scene. It would be very helpful to know which resource is the problematic one. on restarting the editor it said something like
res:// not foundand during the next restart the error message disappearedThis is a known limitation, the rendering server doesn’t know the texture file or anything else like that (nor is it guaranteed to even be known), see:
Godot 3.5
The
Object was deleted while awaiting a callbackmessage should really be a warning or error, and could use more information on what the ‘object’ and the ‘callback’ are/were. Right now the only way to figure out what caused this is by looking at everyContainerin the entire project.Godot 4.2.2
This seems to mean that you’re trying to set a Node’s
ownerto it’s currentowner. Basically, you’re doing something inefficient. It should just say something along the lines of:`Although frankly, it would be better if it just:1. Set it anyway, and didn’t complain.2. Skipped it.3. Gave a warning instead.I see no reason for this to throw an ‘must fix’ error, since setting any other variable to it’s current value is allowed throughout the Engine.Nope, we only use the Godot Editor for our scripts. This error was something my co-developer had in Godot, and when I asked him if he had any clue what could be causing it, he said he had no idea. So I’m afraid I don’t currently have any other info. If we ever figure it out, I’ll let you know.
The new error message I added today should fit the bill 🙂
@Anutrix We probably want to use
ANDROID_ENABLEDas we use<platform>_ENABLEDfor other platform defines.@Anutrix Maybe we should change the error message with an
#ifdefdepending on the target platform?