diff --git a/src/Build/BackEnd/Components/Logging/EventSourceSink.cs b/src/Build/BackEnd/Components/Logging/EventSourceSink.cs index 5e5e883ff08..340dfafc495 100644 --- a/src/Build/BackEnd/Components/Logging/EventSourceSink.cs +++ b/src/Build/BackEnd/Components/Logging/EventSourceSink.cs @@ -537,15 +537,11 @@ private void RaiseProjectStartedEvent(object sender, ProjectStartedEventArgs bui // if a logger has failed politely, abort immediately // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings // if a fellow logger is throwing in an event handler. - this.UnregisterAllEventHandlers(); + UnregisterAllEventHandlers(); throw; } catch (Exception exception) { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllEventHandlers(); - if (ExceptionHandling.IsCriticalException(exception)) { throw; @@ -873,9 +869,9 @@ private void RaiseAnyEvent(object sender, BuildEventArgs buildEvent) // if a logger has failed politely, abort immediately // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings // if a fellow logger is throwing in an event handler. - this.UnregisterAllEventHandlers(); + UnregisterAllEventHandlers(); - // We ought to dump this farther up the stack, but if for example a task is logging an event within a + // We ought to dump this further up the stack, but if for example a task is logging an event within a // catch(Exception) block and not rethrowing it, there's the possibility that this exception could // just get silently eaten. So better to have duplicates than to not log the problem at all. :) ExceptionHandling.DumpExceptionToFile(exception); @@ -884,11 +880,7 @@ private void RaiseAnyEvent(object sender, BuildEventArgs buildEvent) } catch (Exception exception) { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllEventHandlers(); - - // We ought to dump this farther up the stack, but if for example a task is logging an event within a + // We ought to dump this further up the stack, but if for example a task is logging an event within a // catch(Exception) block and not rethrowing it, there's the possibility that this exception could // just get silently eaten. So better to have duplicates than to not log the problem at all. :) ExceptionHandling.DumpExceptionToFile(exception); diff --git a/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs b/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs index e2c2e7cc772..0d98b32f5a8 100644 --- a/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs +++ b/src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs @@ -842,13 +842,20 @@ private async Task BuildAndReport() { // The build was likely cancelled. We do not need to log an error in this case. } - else if (_projectLoggingContext is null) + else if (ex is InternalLoggerException) { - _nodeLoggingContext.LogError(BuildEventFileInfo.Empty, "UnhandledMSBuildError", ex.ToString()); + string realMessage = TaskLoggingHelper.GetInnerExceptionMessageString(ex); + LoggingContext loggingContext = ((LoggingContext)_projectLoggingContext) ?? _nodeLoggingContext; + loggingContext.LogError( + BuildEventFileInfo.Empty, + "FatalErrorWhileLoggingWithInnerException", + realMessage); + + loggingContext.LogCommentFromText(MessageImportance.Low, ex.ToString()); } else { - _projectLoggingContext.LogError(BuildEventFileInfo.Empty, "UnhandledMSBuildError", ex.ToString()); + (((LoggingContext)_projectLoggingContext) ?? _nodeLoggingContext).LogError(BuildEventFileInfo.Empty, "UnhandledMSBuildError", ex.ToString()); } if (ExceptionHandling.IsCriticalException(ex)) diff --git a/src/Build/Resources/Strings.resx b/src/Build/Resources/Strings.resx index 632884ce86c..e2e181616a7 100644 --- a/src/Build/Resources/Strings.resx +++ b/src/Build/Resources/Strings.resx @@ -469,6 +469,13 @@ likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special exception to abort the build. + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. {StrBegin="MSB3094: "} diff --git a/src/Build/Resources/xlf/Strings.cs.xlf b/src/Build/Resources/xlf/Strings.cs.xlf index 047911f93bf..0bd480c66ad 100644 --- a/src/Build/Resources/xlf/Strings.cs.xlf +++ b/src/Build/Resources/xlf/Strings.cs.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: Položka {2} odkazuje na {0} položek a položka {3} odkazuje na {1} položek. Musí mít stejný počet položek. diff --git a/src/Build/Resources/xlf/Strings.de.xlf b/src/Build/Resources/xlf/Strings.de.xlf index 9d40c5707dd..eda7beb09d4 100644 --- a/src/Build/Resources/xlf/Strings.de.xlf +++ b/src/Build/Resources/xlf/Strings.de.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" verweist auf {0} Element(e), und "{3}" verweist auf {1} Element(e). Die Anzahl von Elementen muss identisch sein. diff --git a/src/Build/Resources/xlf/Strings.es.xlf b/src/Build/Resources/xlf/Strings.es.xlf index 4ad2cedbfe7..87312a2d7eb 100644 --- a/src/Build/Resources/xlf/Strings.es.xlf +++ b/src/Build/Resources/xlf/Strings.es.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" hace referencia a {0} elementos y "{3}" hace referencia a {1} elementos. Deben tener el mismo número de elementos. diff --git a/src/Build/Resources/xlf/Strings.fr.xlf b/src/Build/Resources/xlf/Strings.fr.xlf index 3c1431c28be..c15c2f99cfb 100644 --- a/src/Build/Resources/xlf/Strings.fr.xlf +++ b/src/Build/Resources/xlf/Strings.fr.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" fait référence à {0} élément(s) et "{3}", à {1} élément(s). Ils doivent avoir le même nombre d'éléments. diff --git a/src/Build/Resources/xlf/Strings.it.xlf b/src/Build/Resources/xlf/Strings.it.xlf index af45d49d4d6..b77b4329a8c 100644 --- a/src/Build/Resources/xlf/Strings.it.xlf +++ b/src/Build/Resources/xlf/Strings.it.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" fa riferimento a {0} elemento/i, mentre "{3}" fa riferimento a {1} elemento/i. Devono avere lo stesso numero di elementi. diff --git a/src/Build/Resources/xlf/Strings.ja.xlf b/src/Build/Resources/xlf/Strings.ja.xlf index 09f3ec01754..a6e1b1228bb 100644 --- a/src/Build/Resources/xlf/Strings.ja.xlf +++ b/src/Build/Resources/xlf/Strings.ja.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" は {0} 項目を参照し、"{3}" は {1} 項目を参照します。これらは同じ項目数を持たなければなりません。 diff --git a/src/Build/Resources/xlf/Strings.ko.xlf b/src/Build/Resources/xlf/Strings.ko.xlf index 5f21196ef4c..b974ff55299 100644 --- a/src/Build/Resources/xlf/Strings.ko.xlf +++ b/src/Build/Resources/xlf/Strings.ko.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}"은(는) 항목을 {0}개 참조하고 "{3}"은(는) 항목을 {1}개 참조합니다. 참조하는 항목 수는 같아야 합니다. diff --git a/src/Build/Resources/xlf/Strings.pl.xlf b/src/Build/Resources/xlf/Strings.pl.xlf index dafb394d614..015e72cdca9 100644 --- a/src/Build/Resources/xlf/Strings.pl.xlf +++ b/src/Build/Resources/xlf/Strings.pl.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: „{2}” odwołuje się do następującej liczby elementów: {0}, a „{3}” odwołuje się do następującej liczby elementów: {1}. Liczba tych elementów musi być taka sama. diff --git a/src/Build/Resources/xlf/Strings.pt-BR.xlf b/src/Build/Resources/xlf/Strings.pt-BR.xlf index c9b2d280391..832a0dabec2 100644 --- a/src/Build/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Build/Resources/xlf/Strings.pt-BR.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" refere-se ao(s) item(ns) {0} e "{3}" refere-se ao(s) item(ns) {1}. Eles devem ter o mesmo número de itens. diff --git a/src/Build/Resources/xlf/Strings.ru.xlf b/src/Build/Resources/xlf/Strings.ru.xlf index 42cc6134536..886fd142e5c 100644 --- a/src/Build/Resources/xlf/Strings.ru.xlf +++ b/src/Build/Resources/xlf/Strings.ru.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" ссылается на следующее число элементов: {0}, а "{3}" — на {1}. Число элементов должно быть одинаковым. diff --git a/src/Build/Resources/xlf/Strings.tr.xlf b/src/Build/Resources/xlf/Strings.tr.xlf index 809c1d969fe..848fe8d7f80 100644 --- a/src/Build/Resources/xlf/Strings.tr.xlf +++ b/src/Build/Resources/xlf/Strings.tr.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}", {0} öğeye; "{3}", {1} öğeye başvuruyor. Aynı sayıda öğeye sahip olmaları gerekir. diff --git a/src/Build/Resources/xlf/Strings.zh-Hans.xlf b/src/Build/Resources/xlf/Strings.zh-Hans.xlf index 89b16c2d43d..35b361ab160 100644 --- a/src/Build/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Build/Resources/xlf/Strings.zh-Hans.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: “{2}”引用 {0} 个项,而“{3}”引用 {1} 个项。它们必须具有相同的项数。 diff --git a/src/Build/Resources/xlf/Strings.zh-Hant.xlf b/src/Build/Resources/xlf/Strings.zh-Hant.xlf index a28f9eadc87..ab8f018af73 100644 --- a/src/Build/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Build/Resources/xlf/Strings.zh-Hant.xlf @@ -149,6 +149,15 @@ {1} + + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + MSB4017: The build stopped unexpectedly because of an unexpected logger failure. + {0} + {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most + likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a + special exception to abort the build. + MSB3094: "{2}" refers to {0} item(s), and "{3}" refers to {1} item(s). They must have the same number of items. MSB3094: "{2}" 參考 {0} 個項目,"{3}" 則參考 {1} 個項目。兩者參考的項目數目必須相同。