Skip to content

Fix errors not being emitted when debugger breaks on script errors - #107663

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
mihe:script-break-error
Jun 24, 2025
Merged

Repiteo merged 1 commit into
godotengine:masterfrom
mihe:script-break-error

Conversation

@mihe

@mihe mihe commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Fixes #107662.

This does the following:

  1. Errors are now emitted when the built-in debugger breaks on a script error, allowing Logger to intercept such errors.
  2. Effectively changes the location of this emitted error (which applies to the "Ignore Error Breaks" scenario as well) from RemoteDebugger::debug to instead be the actual script location.

@mihe mihe added the bug label Jun 18, 2025
@mihe
mihe requested review from a team as code owners June 18, 2025 09:51
@mihe
mihe force-pushed the script-break-error branch from 0b5f939 to 1b7b443 Compare June 18, 2025 09:52
@mihe mihe changed the title Change it so errors are emitted when debugger breaks on script errors Fix errors not being emitted when debugger breaks on script errors Jun 18, 2025
@AThousandShips AThousandShips added this to the 4.5 milestone Jun 18, 2025

@akien-mga akien-mga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to me.

We looked into it in depth with @mihe and @reduz and couldn't really find why this was written to not emit errors on debugger breaks.

Now that we know it actually prevents proper logging of errors when using a debugger, I think it's time to reconsider this behavior.

CC @raulsntos - does C# support this kind of debugger breaks, and would it affect its behavior?

@raulsntos

Copy link
Copy Markdown
Member

does C# support this kind of debugger breaks, and would it affect its behavior?

No, C# exceptions/errors don't break the debugger. There's very little, if any, integration with the Godot debugger. We may want to change that in the future, but I don't think we'd want a different behavior.

@Repiteo
Repiteo merged commit d97d8c1 into godotengine:master Jun 24, 2025
@Repiteo

Repiteo commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

Thanks!

@mihe
mihe deleted the script-break-error branch June 24, 2025 15:15
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Fix errors not being emitted when debugger breaks on script errors
wangshucheng pushed a commit to wangshucheng/godot that referenced this pull request Aug 27, 2026
Fix errors not being emitted when debugger breaks on script errors
Shane-Gadsby pushed a commit to Shane-Gadsby/godotwebgpu that referenced this pull request Sep 21, 2026
Fix errors not being emitted when debugger breaks on script errors
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.

Logger methods are not called when debugger breaks on script error

5 participants