124 references to ExceptionHandling
Microsoft.Build (110)
BackEnd\BuildManager\BuildManager.cs (11)
1330catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1437catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1448catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1584ExceptionHandling.DumpExceptionToFile(e); 1806catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1879return !ExceptionHandling.IsCriticalException(e) && !ExceptionHandling.NotExpectedException(e) && e is not BuildAbortedException; 2478string exception = ExceptionHandling.ReadAnyExceptionFromFile(_instantiationTimeUtc); 2479loggingService?.LogError(buildEventContext, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, exception); 2488loggingService?.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, shutdownPacket.Exception.ToString()); 2971catch (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 (1)
875if (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)
569catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 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 (3)
1540catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1715catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 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 (5)
569catch (Exception e) when (!ExceptionHandling.NotExpectedRegistryException(e)) 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))
TaskLoader.cs (1)
120taskAppDomain.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)
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);