Skip to content

Degrade logging errors from ClassDB in some cases#118081

Open
Ivorforce wants to merge 1 commit intogodotengine:masterfrom
Ivorforce:class-db-error-relaxation
Open

Degrade logging errors from ClassDB in some cases#118081
Ivorforce wants to merge 1 commit intogodotengine:masterfrom
Ivorforce:class-db-error-relaxation

Conversation

@Ivorforce
Copy link
Copy Markdown
Member

As so often, I'm a bit over eager with printing on unexpected states.
This time, we get unexpected logs from autocompletion (#117914). While somewhat fishy to query ClassDB with classes that don't exist, it's not problematic and we didn't have logs before. So the agnostic thing would be to keep silently ignoring the invalid class name.

We can discuss re-adding those logs in the future. But that would need to be a more sweeping change.

…fore `GDType`, and errors aren't technically needed.
@KoBeWi
Copy link
Copy Markdown
Member

KoBeWi commented Apr 2, 2026

ClassDB has more errors for missing classes:

ERR_FAIL_V_MSG(false, vformat("Cannot get class '%s'.", String(p_class)));

ERR_FAIL_NULL_V_MSG(ti, false, vformat("Cannot get class '%s'.", String(p_class)));

ERR_FAIL_NULL_V_MSG(ti, false, vformat("Cannot get class '%s'.", String(p_class)));

etc.

I think logging an error makes sense. Like, if you want to get constant list from a class, you expect that it returns that list. If you make a typo in class name and the method fails silently, you may spend much time troubleshooting wrong problem.
If we have code that checks for non-existent classes, if the error is a problem, that code should check if the class exists beforehand.

I'd change these errors to be consistent with the ones I linked above though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enum var, typing a period, ERROR Parameter "type" is null

2 participants