1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Fix errors not being emitted when debugger breaks on script errors

This commit is contained in:
Mikael Hermansson
2025-06-17 14:13:32 +02:00
parent 46c495ca21
commit 1b7b44390a
2 changed files with 19 additions and 31 deletions

View File

@@ -104,10 +104,6 @@ Error RemoteDebugger::_put_msg(const String &p_message, const Array &p_data) {
}
void RemoteDebugger::_err_handler(void *p_this, const char *p_func, const char *p_file, int p_line, const char *p_err, const char *p_descr, bool p_editor_notify, ErrorHandlerType p_type) {
if (p_type == ERR_HANDLER_SCRIPT) {
return; //ignore script errors, those go through debugger
}
RemoteDebugger *rd = static_cast<RemoteDebugger *>(p_this);
if (rd->flushing && Thread::get_caller_id() == rd->flush_thread) { // Can't handle recursive errors during flush.
return;
@@ -407,27 +403,24 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
}
}
ScriptLanguage *script_lang = script_debugger->get_break_language();
ERR_FAIL_NULL(script_lang);
const bool can_break = !(p_is_error_breakpoint && script_debugger->is_ignoring_error_breaks());
const String error_str = script_lang ? script_lang->debug_get_error() : "";
if (can_break) {
Array msg = {
p_can_continue,
error_str,
script_lang->debug_get_stack_level_count() > 0,
Thread::get_caller_id()
};
if (allow_focus_steal_fn) {
allow_focus_steal_fn();
}
send_message("debug_enter", msg);
} else {
ERR_PRINT(error_str);
if (p_is_error_breakpoint && script_debugger->is_ignoring_error_breaks()) {
return;
}
ScriptLanguage *script_lang = script_debugger->get_break_language();
ERR_FAIL_NULL(script_lang);
Array msg = {
p_can_continue,
script_lang->debug_get_error(),
script_lang->debug_get_stack_level_count() > 0,
Thread::get_caller_id()
};
if (allow_focus_steal_fn) {
allow_focus_steal_fn();
}
send_message("debug_enter", msg);
Input::MouseMode mouse_mode = Input::MOUSE_MODE_VISIBLE;
if (Thread::get_caller_id() == Thread::get_main_id()) {