Affected components: those inheriting from TelerikSelectBase (e.g., TelerikDropDownList, TelerikComboBox, TelerikMultiSelect, TelerikAutoComplete). When an exception is thrown inside an async Task event handler for the OnChange, OnBlur, OnOpen, and ValueChanged events, the exception is completely and silently swallowed. The exception is not caught by ErrorBoundary.
Related: #6333
Steps to Reproduce
<ErrorBoundary>
<ChildContent>
@Body
</ChildContent>
<ErrorContent>
<p class="error">An unhandled error has occurred.</p>
</ErrorContent>
</ErrorBoundary>
<TelerikDropDownList
Data="@DropDownData"
ValueChanged="@( (int newValue) => OnDropDownValueChanged(newValue))"
TextField="@nameof(TestItem.Name)"
ValueField="@nameof(TestItem.Id)" />
<TelerikButton OnClick="@(() => throw new Exception("Exception from button"))">Click to test ErrorBoundary</TelerikButton>
@code {
private int? SelectedDropDownValue;
private List<TestItem> DropDownData = new()
{
new() { Id = 1, Name = "Select me to throw exception" },
};
private async Task OnDropDownValueChanged(int newValue)
{
throw new InvalidOperationException("This exception should be caught by the ErrorBoundary!");
}
public class TestItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
}
}
The exception thrown in the OnDropDownValueChanged
event handler is not caught by ErrorBoundary.
The exception thrown in the OnDropDownValueChanged
event handler is caught by ErrorBoundary.
All
No response