115 references to ExceptionHandling
Microsoft.Build (101)
BackEnd\BuildManager\BuildManager.cs (12)
40using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 1331catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1438catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1449catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1585ExceptionHandling.DumpExceptionToFile(e); 1807catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1880return !ExceptionHandling.IsCriticalException(e) && !ExceptionHandling.NotExpectedException(e) && e is not BuildAbortedException; 2484string exception = ExceptionHandling.ReadAnyExceptionFromFile(_instantiationTimeUtc); 2485loggingService?.LogError(buildEventContext, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, exception); 2494loggingService?.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, shutdownPacket.Exception.ToString()); 2977catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (6)
241if (ExceptionHandling.IsCriticalException(e)) 260if (ExceptionHandling.IsCriticalException(e)) 299catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 899catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1390ExceptionHandling.DumpExceptionToFile(e); 1398if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
457ExceptionHandling.DumpExceptionToFile(e);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
466catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 905catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Logging\EventSourceSink.cs (5)
364if (ExceptionHandling.IsCriticalException(exception)) 392if (ExceptionHandling.IsCriticalException(exception)) 402ExceptionHandling.DumpExceptionToFile(exception); 412ExceptionHandling.DumpExceptionToFile(exception); 414if (ExceptionHandling.IsCriticalException(exception))
BackEnd\Components\Logging\LoggingService.cs (3)
1473catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException) 1527ExceptionHandling.DumpExceptionToFile(e); 1813catch (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)
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 (2)
811if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 902if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\Scheduler\Scheduler.cs (4)
2577catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2691catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2731catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2758catch (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)
374catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 513catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 656catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 986catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1355catch (Exception e) when (e is not LoggerException && e is not InternalLoggerException && !ExceptionHandling.NotExpectedReflectionException(e)) 1605catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
Construction\ProjectRootElement.cs (2)
2036catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2087catch (Exception ex) when (!ExceptionHandling.NotExpectedIoOrXmlException(ex))
Construction\Solution\SolutionFile.cs (2)
25using ExceptionUtilities = Microsoft.Build.Shared.ExceptionHandling; 727catch (Exception e) when (ExceptionUtilities.IsIoRelatedException(e))
Construction\Solution\SolutionProjectGenerator.cs (1)
2179catch (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)
716catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 966catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1008catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1052catch (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)
2030catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2075catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Evaluation\Expander.cs (6)
1729catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 2371catch (Exception e) when (!ExceptionHandling.NotExpectedException(e) || e is InvalidOperationException) 2424catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2508catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2581catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 3665catch (Exception ex) when (!ExceptionHandling.NotExpectedFunctionException(ex))
ExceptionHandling.cs (1)
343lock (typeof(ExceptionHandling))
FileMatcher.cs (4)
2011catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2595if (ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException)) 2601catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2619return 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)
1329catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1449catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 1528catch (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)
473catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 481ExceptionHandling.DumpExceptionToFile(e); 562ExceptionHandling.DumpExceptionToFile(e); 606ExceptionHandling.DumpExceptionToFile(e); 655ExceptionHandling.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);