Skip to content

Commit

Permalink
fix: TerminalErrorDetector should return true on JSDisconnectedException
Browse files Browse the repository at this point in the history
  • Loading branch information
alexyakunin committed Dec 5, 2023
1 parent 7ff77f9 commit ca101a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Stl/TerminalError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public static bool IsServiceProviderDisposedException(Exception error)
{
if (error is not ObjectDisposedException ode)
return false;
if (Equals(error.GetType().Name, "JSDisconnectedException"))
return true; // This is specific to Blazor Server, it also indicates the scope is going to die soon

#if NETSTANDARD2_0
return ode.ObjectName.Contains("IServiceProvider")
|| ode.Message.Contains("'IServiceProvider'");
Expand Down

0 comments on commit ca101a5

Please sign in to comment.