Avoid lots of uncessary exceptions during layout XML merge loading #37570
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.
Description
Related Pull Requests
See also: justbetter/magento2-sentry#113
Fixed Issues (if relevant)
No magento issue created.
Manual testing scenarios (*)
Reason
When using tools like Sentry, because of there inner workings, such exceptions still might be reported. While this is not exactly the root cause, it's always cleaner to not throw an exception and immediately catch it, if invalid cases can happen often.
This might even improve performance a bit and improves developer's experience.
Remarks
There seems some invalid XML at that place in the code happen quite often - it might be also interesting to check if that can be avoided.
This is a simple, trivial change to the code and should not break anything, so hopefully this can get triaged quickly and without to much back-and-forth about the testing procedure :-)
Contribution checklist (*)