Skip to content

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

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

mihe
Copy link
Contributor

@mihe mihe commented Jun 18, 2025

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
Copy link
Member

@akien-mga akien-mga left a comment

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
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
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 24, 2025

Thanks!

@mihe mihe deleted the script-break-error branch June 24, 2025 15:15
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