Skip to content

Add _err_print_script_error helper methods - #2022

Open
Naros wants to merge 1 commit into
godotengine:masterfrom
Naros:add-err_print_script_error
Open

Naros wants to merge 1 commit into
godotengine:masterfrom
Naros:add-err_print_script_error

Conversation

@Naros

@Naros Naros commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@dsnopek as discussed on RChat, here's the implementations for the "print_script_error" APIs

@dsnopek dsnopek left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I think this should have some #ifdefs to handle the being compiled when targeting Godot 4.7 and earlier. We could maybe have the _err_print_script_error() functions fallback to print_error()?

Also, how are developers meant to call the _err_print_script_error() functions? We need a public API. If we're to match Godot's internals, this would be _err_print_error() with an ErrorHandlerType enum, but maybe it'd be better to add a nicer API to Godot for this (and then have godot-cpp match that)?

@dsnopek dsnopek added the enhancement This is an enhancement on the current functionality label Jul 24, 2026
@dsnopek dsnopek added this to the 10.x milestone Jul 24, 2026
@dsnopek

dsnopek commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

It turns out we already had print_script_error in the GDExtension interface :-)

Anyway, this one either (1) needs to be made compatible with Godot somehow (so we have the same public API in Godot and godot-cpp), or (2) closed and folks who need it can just use godot::gdextension_interface::print_script_error() directly

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

Labels

enhancement This is an enhancement on the current functionality

2 participants