From 2170a575f2f25a0da9614fcdc291d25e14a8f0fa Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Wed, 9 Oct 2019 00:11:46 +0200 Subject: [PATCH] Log exceptions thrown while terminating components --- src/Umbraco.Core/Composing/ComponentCollection.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Composing/ComponentCollection.cs b/src/Umbraco.Core/Composing/ComponentCollection.cs index 82c5ca78d3..a88f17bc07 100644 --- a/src/Umbraco.Core/Composing/ComponentCollection.cs +++ b/src/Umbraco.Core/Composing/ComponentCollection.cs @@ -39,8 +39,6 @@ namespace Umbraco.Core.Composing { using (_logger.DebugDuration($"Terminating. (log components when >{LogThresholdMilliseconds}ms)", "Terminated.")) { - var exceptions = new List(); - foreach (var component in this.Reverse()) // terminate components in reverse order { var componentType = component.GetType(); @@ -53,15 +51,10 @@ namespace Umbraco.Core.Composing } catch (Exception ex) { - exceptions.Add(ex); + _logger.Error(componentType, ex, "Error while terminating component."); } } } - - if (exceptions.Count > 0) - { - throw new AggregateException("One or more errors occurred while terminating components.", exceptions); - } } } }