126 references to ExceptionHandling
Microsoft.Build (112)
BackEnd\BuildManager\BuildManager.cs (12)
41using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 1367catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1474catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1485catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1621ExceptionHandling.DumpExceptionToFile(e); 1843catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1916return !ExceptionHandling.IsCriticalException(e) && !ExceptionHandling.NotExpectedException(e) && e is not BuildAbortedException; 2520string exception = ExceptionHandling.ReadAnyExceptionFromFile(_instantiationTimeUtc); 2521loggingService?.LogError(buildEventContext, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, exception); 2530loggingService?.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, shutdownPacket.Exception.ToString()); 3031catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (6)
241if (ExceptionHandling.IsCriticalException(e)) 260if (ExceptionHandling.IsCriticalException(e)) 302catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 902catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1393ExceptionHandling.DumpExceptionToFile(e); 1401if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
457ExceptionHandling.DumpExceptionToFile(e);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
471catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 917catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Logging\EventSourceSink.cs (5)
371if (ExceptionHandling.IsCriticalException(exception)) 399if (ExceptionHandling.IsCriticalException(exception)) 409ExceptionHandling.DumpExceptionToFile(exception); 419ExceptionHandling.DumpExceptionToFile(exception); 421if (ExceptionHandling.IsCriticalException(exception))
BackEnd\Components\Logging\LoggingService.cs (3)
1453catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException) 1507ExceptionHandling.DumpExceptionToFile(e); 1793catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
27using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 876if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
841if (ExceptionHandling.IsCriticalException(ex)) 846ExceptionHandling.DumpExceptionToFile(ex); 884catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (3)
990catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1015catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1050catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
BackEnd\Components\RequestBuilder\TaskBuilder.cs (3)
573catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 815if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 906if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\Scheduler\Scheduler.cs (4)
2573catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2687catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2727catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2754catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Node\InProcNode.cs (2)
185ExceptionHandling.DumpExceptionToFile(e); 324catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Node\OutOfProcNode.cs (1)
810catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
378catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 517catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 660catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 990catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1362catch (Exception e) when (e is not LoggerException && e is not InternalLoggerException && !ExceptionHandling.NotExpectedReflectionException(e)) 1620catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
Construction\ProjectRootElement.cs (2)
2071catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2122catch (Exception ex) when (!ExceptionHandling.NotExpectedIoOrXmlException(ex))
Construction\Solution\SolutionFile.cs (2)
24using ExceptionUtilities = Microsoft.Build.Shared.ExceptionHandling; 749catch (Exception e) when (ExceptionUtilities.IsIoRelatedException(e))
Construction\Solution\SolutionProjectGenerator.cs (3)
1553catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1728catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2192catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) // We don't want any problems scanning the project file to result in aborting the build.
Definition\Project.cs (1)
480catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
Definition\Toolset.cs (5)
579catch (Exception e) when (!ExceptionHandling.NotExpectedRegistryException(e)) 726catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 976catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1018catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1062catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Definition\ToolsetReader.cs (1)
632catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (1)
60catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Evaluator.cs (2)
2047catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2092catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Evaluation\Expander.cs (6)
1735catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 2377catch (Exception e) when (!ExceptionHandling.NotExpectedException(e) || e is InvalidOperationException) 2430catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2514catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2587catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 3684catch (Exception ex) when (!ExceptionHandling.NotExpectedFunctionException(ex))
ExceptionHandling.cs (1)
342lock (typeof(ExceptionHandling))
FileMatcher.cs (4)
1999catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2584if (ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException)) 2595catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2617return ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException);
FileUtilities.cs (5)
816catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 896catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 933catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 1001catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1265catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FrameworkLocationHelper.cs (1)
991catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
305catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 456catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
Instance\TaskRegistry.cs (3)
1413catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1533catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 1612catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
149catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Logging\FileLogger.cs (2)
122catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 151catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Logging\LoggerDescription.cs (1)
170when (!(e is LoggerException /* Polite logger Failure*/ || e is InternalLoggerException /* LoggerClass not found*/ || ExceptionHandling.IsCriticalException(e)))
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NodeEndpointOutOfProcBase.cs (5)
474catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 482ExceptionHandling.DumpExceptionToFile(e); 566ExceptionHandling.DumpExceptionToFile(e); 610ExceptionHandling.DumpExceptionToFile(e); 667ExceptionHandling.DumpExceptionToFile(e);
RegisteredTaskObjectCacheBase.cs (1)
151catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
TaskLoader.cs (1)
118taskAppDomain.UnhandledException += ExceptionHandling.UnhandledExceptionHandler;
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ToolsetElement.cs (1)
101catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Utilities\RegistryKeyWrapper.cs (6)
87catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 117catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 133catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 149catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 176if (ExceptionHandling.NotExpectedRegistryException(ex)) 213catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex))
Microsoft.Build.Engine.UnitTests (14)
BackEnd\DebugUtils_tests.cs (3)
20var exceptionFilesBefore = Directory.GetFiles(ExceptionHandling.DebugDumpPath, "MSBuild_*failure.txt"); 26ExceptionHandling.DumpExceptionToFile(new Exception("hello world")); 27exceptionFiles = Directory.GetFiles(ExceptionHandling.DebugDumpPath, "MSBuild_*failure.txt");
BackEnd\EventSourceSink_Tests.cs (8)
177Assert.False(ExceptionHandling.IsCriticalException(e)); 187Assert.False(ExceptionHandling.IsCriticalException(e)); 198Assert.False(ExceptionHandling.IsCriticalException(e)); 212Assert.False(ExceptionHandling.IsCriticalException(e)); 222Assert.True(ExceptionHandling.IsCriticalException(e)); 233Assert.True(ExceptionHandling.IsCriticalException(e)); 247Assert.True(ExceptionHandling.IsCriticalException(e)); 276if (ExceptionHandling.IsCriticalException(e))
BackEnd\TaskExecutionHost_Tests.cs (3)
1089File.Exists(ExceptionHandling.DumpFilePath).ShouldBe(isCritical, 1090$"{ExceptionHandling.DumpFilePath} expected to exist: {isCritical}"); 1093FileUtilities.DeleteNoThrow(ExceptionHandling.DumpFilePath);