Skip to content

Errors from godot registration functions are not detected #1024

Open
@0x53A

Description

I stumbled upon this here: #1019 (comment)

See also: godotengine/godot#101870

The issue is that in godot, classdb_register_extension_class_method returns void.

If an error occurs, it just prints an error and returns:

https://github.com/godotengine/godot/blob/1b7b009674e05b566be11a5377b935f5d3d6c0ee/core/object/class_db.cpp#L1879-L1882

	if (type->method_map.has(p_method->get_name())) {
		// overloading not supported
		ERR_FAIL_MSG(vformat("Method already bound '%s::%s'.", p_class, p_method->get_name()));
	}

The macro ERR_FAIL_MSG ultimately calls _err_print_error

which prints to stderr and calls all handlers registered in error_handler_list.

At the least for debug / CI, it would be great to register a handler, and fail CI if an error occurs.

Metadata

Assignees

No one assigned

    Labels

    c: registerRegister classes, functions and other symbols to GDScriptquality-of-lifeNo new functionality, but improves ergonomics/internals

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions