From 1c36c72daa712b73c99061b20022c4b40a5d7815 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:50:28 -0400 Subject: [PATCH] Follow-up example update (#33597) --- aspnetcore/blazor/fundamentals/handle-errors.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/fundamentals/handle-errors.md b/aspnetcore/blazor/fundamentals/handle-errors.md index 24b1962ab2..6d28100fdd 100644 --- a/aspnetcore/blazor/fundamentals/handle-errors.md +++ b/aspnetcore/blazor/fundamentals/handle-errors.md @@ -454,7 +454,7 @@ The following example permits the user to recover from the exception with a butt } ``` -You can also subclass for custom processing by overriding . The following example merely logs the error, but you can implement any error handling code you wish. You can remove the line that returns a if your code awaits an asynchronous task. +You can also subclass for custom processing by overriding . The following example merely logs the error, but you can implement any error handling code you wish. You can remove the line that awaits a if your code awaits an asynchronous task. `CustomErrorBoundary.razor`: @@ -475,7 +475,7 @@ else if (ErrorContent is not null) protected override Task OnErrorAsync(Exception ex) { Logger.LogError(ex, "😈 A rotten gremlin got us. Sorry!"); - return Task.CompletedTask; + await Task.CompletedTask; } } ``` @@ -498,7 +498,7 @@ public class CustomErrorBoundary : ErrorBoundary protected override async Task OnErrorAsync(Exception ex) { Logger.LogError(ex, "😈 A rotten gremlin got us. Sorry!"); - return Task.CompletedTask; + await Task.CompletedTask; } } ```