Improve error message in text resource format parser #86350
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to my debugging of #77007 and should help users identify potential recursion points in order to circumvent or fix these issues with a work around while we continue to find a fix on an engine level.
This improves the error message in our text resource parsing code to help the user potentially fix parsing issues in case of failure. It also helps with the debugging process of finding out which sub_resource is causing the parser to fail with line messages and resource paths.
Old error message:
New error message:
This notably:
1 - Gives us the error code, which can help identify which conditional down the code path is flagging an error. It can also potentially help us determine whether or not the error is valid (In this example, the error code is
Busy
).2 - Tells the user which file is problematic and which line the parser failed on. The line of failure is important as it empowers the user to find a work around in the worst case scenario, but also helps them find potential mistakes that they may have made during a git conflict resolution.
I'll continue to look into causes for the bug but I think we should consider making our error message here more verbose to help with the debugging process of future tscn parsing bugs. :)