Skip to content

Commit f8f9a84

Browse files
committed
Simplify ErrorBoundary test cases
1 parent 82cb844 commit f8f9a84

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

src/Components/test/testassets/BasicTestApp/ErrorBoundaryTest/ErrorBoundaryCases.razor

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -154,36 +154,12 @@
154154

155155
async Task SyncExceptionDispatch()
156156
{
157-
try
158-
{
159-
await InvokeAsync(() =>
160-
{
161-
throw new InvalidTimeZoneException("Synchronous exception in SyncExceptionDispatch");
162-
});
163-
}
164-
catch (Exception e)
165-
{
166-
await DispatchExceptionAsync(e);
167-
}
157+
await DispatchExceptionAsync(new InvalidTimeZoneException("Synchronous exception in SyncExceptionDispatch"));
168158
}
169159

170160
async Task AsyncExceptionDispatch()
171161
{
172-
try
173-
{
174-
await InvokeAsync(async () =>
175-
{
176-
await ThrowExceptionAsync();
177-
});
178-
}
179-
catch (Exception e)
180-
{
181-
await DispatchExceptionAsync(e);
182-
}
183-
}
184-
185-
private Task ThrowExceptionAsync()
186-
{
187-
throw new InvalidTimeZoneException("Asynchronous exception in AsyncExceptionDispatch");
162+
await Task.Yield();
163+
await DispatchExceptionAsync(new InvalidTimeZoneException("Asynchronous exception in AsyncExceptionDispatch"));
188164
}
189165
}

0 commit comments

Comments
 (0)