Skip to content
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

Expose add_error_handler() to GDExtensions #11618

Open
0x53A opened this issue Jan 21, 2025 · 0 comments
Open

Expose add_error_handler() to GDExtensions #11618

0x53A opened this issue Jan 21, 2025 · 0 comments

Comments

@0x53A
Copy link

0x53A commented Jan 21, 2025

Describe the project you are working on

Some functions in godot return void, with the only indication that an error happened with a call to all registered error handlers.

One example is GDExtension::_register_extension_class_method, which returns void, but silently fails if a method with the same name was already registered.

Internally in godot, there's an ErrorDetector.

It would be extremely useful to be able to use the same mechanism in an gdextension, rust in my case.

Describe the problem or limitation you are having in your project

Some errors are silently ignored when testing a GDExtension, for example in gdext-rust, I accidentally registered a method twice, and I only noticed this because of a memory leak.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Expose the two functions add_error_handler and remove_error_handler to GDExtensions

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

/

If this enhancement will not be used often, can it be worked around with a few lines of script?

/

Is there a reason why this should be core and not an add-on in the asset library?

/

@Calinou Calinou changed the title Expose add_error_handler to gdextensions Expose add_error_handler() to GDExtensions Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants