From 19718f6011b9d0124e805af61584fda934a6f982 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Fri, 18 Oct 2019 22:03:52 +0200 Subject: [PATCH] =?UTF-8?q?[Blazor][Fixes=20#15155]=20Clarifies=20the=20me?= =?UTF-8?q?ssage=20to=20turn=20on=20detailed=20erro=E2=80=A6=20(#15156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/aspnet/AspNetCore/issues/15155 --- src/Components/Server/src/Circuits/CircuitHost.cs | 6 +++--- .../ComponentHubInvalidEventTest.cs | 6 +++--- .../ComponentHubReliabilityTest.cs | 4 ++-- .../appsettings.Development.json | 13 +++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Components/Server/src/Circuits/CircuitHost.cs b/src/Components/Server/src/Circuits/CircuitHost.cs index bfb4b0cdae..68c4a01d2d 100644 --- a/src/Components/Server/src/Circuits/CircuitHost.cs +++ b/src/Components/Server/src/Circuits/CircuitHost.cs @@ -225,7 +225,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits Log.ConnectionUp(_logger, CircuitId, Client.ConnectionId); Renderer.Dispatcher.AssertAccess(); - + List exceptions = null; for (var i = 0; i < _circuitHandlers.Length; i++) @@ -254,7 +254,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits Log.ConnectionDown(_logger, CircuitId, Client.ConnectionId); Renderer.Dispatcher.AssertAccess(); - + List exceptions = null; for (var i = 0; i < _circuitHandlers.Length; i++) @@ -545,7 +545,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits else { return $"There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on " + - $"detailed exceptions in '{typeof(CircuitOptions).Name}.{nameof(CircuitOptions.DetailedErrors)}'. {additionalInformation}"; + $"detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set '{typeof(CircuitOptions).Name}.{nameof(CircuitOptions.DetailedErrors)}'. {additionalInformation}"; } } diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs index 65b48594f0..26bce75205 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs @@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { // Arrange var expectedError = $"There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on " + - $"detailed exceptions in 'CircuitOptions.DetailedErrors'. Bad input data."; + $"detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. Bad input data."; var eventDescriptor = Serialize(new WebEventDescriptor() { @@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { // Arrange var expectedError = $"There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on " + - $"detailed exceptions in 'CircuitOptions.DetailedErrors'. Failed to dispatch event."; + $"detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. Failed to dispatch event."; var eventDescriptor = Serialize(new WebEventDescriptor() { @@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { // Arrange var expectedError = $"There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on " + - $"detailed exceptions in 'CircuitOptions.DetailedErrors'. Failed to complete render batch '1846'."; + $"detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. Failed to complete render batch '1846'."; Client.ConfirmRenderBatch = false; diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs index 42eae05174..707aad52b9 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs @@ -216,7 +216,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { // Arrange var expectedError = "There was an unhandled exception on the current circuit, so this circuit will be terminated. " + - "For more details turn on detailed exceptions in 'CircuitOptions.DetailedErrors'. " + + "For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. " + "Location change to 'http://example.com' failed."; var rootUri = ServerFixture.RootUri; @@ -245,7 +245,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { // Arrange var expectedError = "There was an unhandled exception on the current circuit, so this circuit will be terminated. " + - "For more details turn on detailed exceptions in 'CircuitOptions.DetailedErrors'. " + + "For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. " + "Location change failed."; var rootUri = ServerFixture.RootUri; diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/appsettings.Development.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/appsettings.Development.json index dba68eb124..2defd04095 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/appsettings.Development.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/appsettings.Development.json @@ -1,9 +1,10 @@ -{ - "Logging": { - "LogLevel": { +{ + "DetailedErrors": true, + "Logging": { + "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" - } - } -} + } + } +}