From f862adc3fc83ed5ca7814887c40024c0a051250d Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 27 Dec 2021 10:48:07 -0800 Subject: [PATCH] Include the exception when logging in WebAssemblyErrorBoundaryLogger Fixes https://github.com/dotnet/aspnetcore/issues/39039 --- .../src/Services/WebAssemblyErrorBoundaryLogger.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyErrorBoundaryLogger.cs b/src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyErrorBoundaryLogger.cs index bfeff39251f5..97db51b9fe09 100644 --- a/src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyErrorBoundaryLogger.cs +++ b/src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyErrorBoundaryLogger.cs @@ -1,14 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components.Web; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Components.WebAssembly.Services; -internal class WebAssemblyErrorBoundaryLogger : IErrorBoundaryLogger +internal sealed class WebAssemblyErrorBoundaryLogger : IErrorBoundaryLogger { private readonly ILogger _errorBoundaryLogger; @@ -21,7 +19,7 @@ public ValueTask LogErrorAsync(Exception exception) { // For, client-side code, all internal state is visible to the end user. We can just // log directly to the console. - _errorBoundaryLogger.LogError(exception.ToString()); + _errorBoundaryLogger.LogError(exception.ToString(), exception); return ValueTask.CompletedTask; } }