From 1655a8fd6d8b7405ce23fb925918b7c4854655bb Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 23 Apr 2018 12:07:51 -0700 Subject: [PATCH] Disable writing to console if exceptions are expected --- test/shared/TestApplicationErrorLogger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shared/TestApplicationErrorLogger.cs b/test/shared/TestApplicationErrorLogger.cs index f447a32b38..731c7b8b94 100644 --- a/test/shared/TestApplicationErrorLogger.cs +++ b/test/shared/TestApplicationErrorLogger.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Testing public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) { #if true - if (logLevel == LogLevel.Critical && ThrowOnCriticalErrors) + if (logLevel == LogLevel.Critical && ThrowOnCriticalErrors && !IgnoredExceptions.Contains(exception.GetType())) #endif { var log = $"Log {logLevel}[{eventId}]: {formatter(state, exception)} {exception}";