Error handling is different for compiled bindings #22078
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
s/needs-attention
Issue has more information and needs another look
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
When the getter of a property throws a
NullReferenceException
, this will be caught and silently ignored for compiled bindings, there won't even be a diagnostic-log viaBindingDiagnostics.SendBindingFailure
.Binding expressions however execute the getter without any try/catch and will therefore throw.
If this difference in error-handling is on purpose, I'd ask to document this on the "Compiled bindings" page and add some logging via
BindingDiagnostics.SendBindingFailure
.I'd prefer to have the behavior aligned either way, but if it is decided that it should not throw, I would really like to see some logging so that this can be caught in a UnitTest, for example.
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/DarkStarDS9/MauiIssues
Version with bug
8.0.21 SR4.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: