Unplanned
Last Updated: 06 Oct 2025 14:03 by Sadik
Sadik
Created on: 06 Oct 2025 14:03
Category: UI for Blazor
Type: Bug Report
0
Exception thrown in "select" component events is not caught by ErrorBoundary

Description

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

Steps to Reproduce

  1. Use a standard ErrorBoundary in MainLayout.razor.
<ErrorBoundary>
    <ChildContent>
        @Body
    </ChildContent>
    <ErrorContent>
        <p class="error">An unhandled error has occurred.</p>
    </ErrorContent>
</ErrorBoundary>
  1. Declare a TelerikDropDownList and bind an async Task method to the ValueChanged or OnChange event.
<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;
    }
}
  1. Run the page and select the item in the DropDownList's list.

Actual Behavior

The exception thrown in the OnDropDownValueChanged event handler is not caught by ErrorBoundary.

Expected Behavior

The exception thrown in the OnDropDownValueChanged event handler is caught by ErrorBoundary.

Browser

All

Last working version of Telerik UI for Blazor (if regression)

No response

0 comments