Repository navigation
Improve circuit initialization error message for failed CircuitHandler dependency resolution - #68078
Merged
ilonatommy merged 2 commits intoJul 29, 2026
Conversation
Contributor
|
Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
ilonatommy
approved these changes
Jul 29, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improve circuit initialization error message for failed CircuitHandler dependency resolution
Description
When a Blazor Server
CircuitHandlercannot be instantiated because of an unresolved dependency, the client only sees a genericError: The circuit failed to initialize.in the browser console, and the underlyingInvalidOperationExceptionis logged on the server atDebuglevel. This makes the misconfiguration very hard to debug.This change updates the error message sent to the client in
ComponentHubto point developers at the server logs, where the actual exception is already captured. No exception details are sent to the client, and the server log level is unchanged.Changes
NotifyClientErrorcall inStartCircuit(ComponentHub.cs) to send"The circuit failed to initialize. See the server logs for more information.".NotifyClientErrorcall in the circuit resume path (ComponentHub.cs).Log.CircuitInitializationFailedand the server log level untouched.Before
Client console:
After
Client console:
Testing
StartCircuitFailsWithUnresolvedCircuitHandlerDependency_NotifiesClientToCheckServerLogsinComponentHubTest.csto verify the updated client message and thatStartCircuitreturnsnullwhen the circuit factory throws anInvalidOperationException.ResumeCircuitFailsWithUnresolvedCircuitHandlerDependency_NotifiesClientToCheckServerLogsto cover the same scenario on the resume path, including the persisted circuit state plumbing.InitializeComponentHubhelper to accept an injectableICircuitFactoryso both tests can supply a failing mock.Fixes #53300