123 references to ExceptionHandling
Microsoft.Build (108)
BackEnd\BuildManager\BuildManager.cs (12)
41using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 1410catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1517catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1528catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1664ExceptionHandling.DumpExceptionToFile(e); 1886catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1959return !ExceptionHandling.IsCriticalException(e) && !ExceptionHandling.NotExpectedException(e) && e is not BuildAbortedException; 2567string exception = ExceptionHandling.ReadAnyExceptionFromFile(_instantiationTimeUtc); 2568loggingService?.LogError(buildEventContext, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, exception); 2577loggingService?.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, shutdownPacket.Exception.ToString()); 3085catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (6)
251if (ExceptionHandling.IsCriticalException(e)) 270if (ExceptionHandling.IsCriticalException(e)) 312catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 920catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1428ExceptionHandling.DumpExceptionToFile(e); 1436if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
465ExceptionHandling.DumpExceptionToFile(e);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (2)
481catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 968catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Logging\EventSourceSink.cs (5)
322if (ExceptionHandling.IsCriticalException(exception)) 414if (ExceptionHandling.IsCriticalException(exception)) 424ExceptionHandling.DumpExceptionToFile(exception); 434ExceptionHandling.DumpExceptionToFile(exception); 436if (ExceptionHandling.IsCriticalException(exception))
BackEnd\Components\Logging\LoggingService.cs (3)
1465catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException) 1519ExceptionHandling.DumpExceptionToFile(e); 1805catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
27using ExceptionHandling = Microsoft.Build.Shared.ExceptionHandling; 1005if (ExceptionHandling.IsCriticalException(e))
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
842if (ExceptionHandling.IsCriticalException(ex)) 847ExceptionHandling.DumpExceptionToFile(ex); 887catch (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)
818if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 909if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\Scheduler\Scheduler.cs (4)
2684catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2815catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2855catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2882catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Node\InProcNode.cs (2)
190ExceptionHandling.DumpExceptionToFile(e); 329catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\Node\OutOfProcNode.cs (1)
819catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
404catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 543catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 686catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1044catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1417catch (Exception e) when (e is not LoggerException && e is not InternalLoggerException && !ExceptionHandling.NotExpectedReflectionException(e)) 1703catch (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 (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)
480catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
Definition\Toolset.cs (4)
607catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 864catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 911catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 957catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Definition\ToolsetReader.cs (1)
626catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (1)
60catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Evaluation\Evaluator.cs (2)
2081catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2126catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Evaluation\Expander.cs (6)
1812catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex)) 2556catch (Exception e) when (!ExceptionHandling.NotExpectedException(e) || e is InvalidOperationException) 2609catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2693catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2766catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 4154catch (Exception ex) when (!ExceptionHandling.NotExpectedFunctionException(ex))
ExceptionHandling.cs (1)
364lock (typeof(ExceptionHandling))
FileMatcher.cs (4)
2026catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2611if (ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException)) 2622catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2644return ex.Flatten().InnerExceptions.All(ExceptionHandling.IsIoRelatedException);
FileUtilities.cs (6)
756catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 845catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 925catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 962catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 1030catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1294catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FrameworkLocationHelper.cs (1)
1024catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
323catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 494catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
Instance\TaskRegistry.cs (3)
1438catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1566catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 1649catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
LoadedType.cs (4)
98catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 115catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 126catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 138catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
149catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Logging\FileLogger.cs (2)
121catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 150catch (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)
401catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NodeEndpointOutOfProcBase.cs (5)
503catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 511ExceptionHandling.DumpExceptionToFile(e); 660ExceptionHandling.DumpExceptionToFile(e); 715ExceptionHandling.DumpExceptionToFile(e); 774ExceptionHandling.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))
TypeUtilities.cs (2)
49catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 68catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
Microsoft.Build.Engine.UnitTests (15)
BackEnd\DebugUtils_tests.cs (4)
20ExceptionHandling.ResetDebugDumpPathInRunningTests = true; 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);