115 references to ExceptionHandling
Microsoft.Build (101)
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()); 3032catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (6)
242if (ExceptionHandling.IsCriticalException(e)) 261if (ExceptionHandling.IsCriticalException(e)) 303catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 903catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1394ExceptionHandling.DumpExceptionToFile(e); 1402if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
457ExceptionHandling.DumpExceptionToFile(e);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
469catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 906catch (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)
25using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 876if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
842if (ExceptionHandling.IsCriticalException(ex)) 847ExceptionHandling.DumpExceptionToFile(ex); 885catch (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 (2)
815if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 906if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\Scheduler\Scheduler.cs (4)
2574catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2688catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2728catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2755catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Node\InProcNode.cs (2)
185ExceptionHandling.DumpExceptionToFile(e); 314catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Node\OutOfProcNode.cs (1)
798catch (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)
2063catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2114catch (Exception ex) when (!ExceptionHandling.NotExpectedIoOrXmlException(ex))
Construction\Solution\SolutionFile.cs (2)
25using ExceptionUtilities = Microsoft.Build.Shared.ExceptionHandling; 735catch (Exception e) when (ExceptionUtilities.IsIoRelatedException(e))
Construction\Solution\SolutionProjectGenerator.cs (1)
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)
474catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
Definition\Toolset.cs (4)
725catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 975catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1017catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1061catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Definition\ToolsetReader.cs (1)
632catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (1)
61catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Evaluator.cs (2)
2044catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2089catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Evaluation\Expander.cs (6)
1731catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 2373catch (Exception e) when (!ExceptionHandling.NotExpectedException(e) || e is InvalidOperationException) 2426catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2510catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2583catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 3703catch (Exception ex) when (!ExceptionHandling.NotExpectedFunctionException(ex))
ExceptionHandling.cs (1)
343lock (typeof(ExceptionHandling))
FileMatcher.cs (4)
2014catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2599if (ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException)) 2610catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2632return ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException);
FileUtilities.cs (5)
789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FrameworkLocationHelper.cs (1)
988catch (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)
1415catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1535catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 1614catch (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)
472catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 480ExceptionHandling.DumpExceptionToFile(e); 564ExceptionHandling.DumpExceptionToFile(e); 608ExceptionHandling.DumpExceptionToFile(e); 665ExceptionHandling.DumpExceptionToFile(e);
RegisteredTaskObjectCacheBase.cs (1)
151catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ToolsetElement.cs (1)
101catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Microsoft.Build.Engine.UnitTests (14)
BackEnd\DebugUtils_tests.cs (3)
21var exceptionFilesBefore = Directory.GetFiles(ExceptionHandling.DebugDumpPath, "MSBuild_*failure.txt"); 27ExceptionHandling.DumpExceptionToFile(new Exception("hello world")); 28exceptionFiles = 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)
1090File.Exists(ExceptionHandling.DumpFilePath).ShouldBe(isCritical, 1091$"{ExceptionHandling.DumpFilePath} expected to exist: {isCritical}"); 1094FileUtilities.DeleteNoThrow(ExceptionHandling.DumpFilePath);