307 types derived from Exception
Aspire.EndToEnd.Tests (1)
tests\Shared\WorkloadTesting\ToolCommandException.cs (1)
6public class ToolCommandException : Exception
Aspire.Hosting (1)
DistributedApplicationException.cs (1)
9public class DistributedApplicationException : Exception
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\ToolCommandException.cs (1)
6public class ToolCommandException : Exception
BasicWebSite (1)
Controllers\AsyncActionsController.cs (1)
254public class CustomException : Exception
ClientSample (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
Crossgen2Tasks (1)
CommonFilePulledFromSdkRepo\BuildErrorException.cs (1)
13internal sealed class BuildErrorException : Exception
dotnet-dev-certs (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
dotnet-getdocument (2)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
src\Tools\GetDocumentInsider\src\CommandException.cs (1)
8internal sealed class CommandException : Exception
dotnet-openapi (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
dotnet-sql-cache (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
dotnet-svcutil-lib (24)
Bootstrapper\BootstrapException.cs (1)
12internal class BootstrapException : Exception
FrameworkFork\Microsoft.CodeDom\Configuration\ConfigurationErrorsException.cs (1)
9internal class ConfigurationErrorsException : Exception
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (1)
23internal class UpaException : Exception
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaException.cs (1)
17public class XmlSchemaException : System.Exception
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (1)
2889internal class CodeGeneratorConversionException : Exception
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (1)
19public class XmlException : System.Exception
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathException.cs (1)
16public class XPathException : System.Exception
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\InvalidDataContractException.cs (1)
10public class InvalidDataContractException : Exception
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SerializationException.cs (1)
9public class SerializationException : Exception
FrameworkFork\System.ServiceModel\Internals\System\Runtime\FatalException.cs (1)
7internal class FatalException : Exception
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (1)
1003internal class InternalException : Exception
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityMessageSerializationException.cs (1)
7public class SecurityMessageSerializationException : Exception
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityTokenException.cs (1)
7public class SecurityTokenException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\InvalidChannelBindingException.cs (1)
9public class InvalidChannelBindingException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\CommunicationException.cs (1)
7public class CommunicationException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ImportedPolicyConversionContext.cs (1)
215internal class MaxItemsEnumeratorExceededMaxItemsException : Exception { }
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationGenerator.cs (1)
1036internal class ParameterModeException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (1)
1921private class WsdlImportException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InvalidBodyAccessException.cs (1)
7internal abstract class InvalidBodyAccessException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\InvalidMessageContractException.cs (1)
10public class InvalidMessageContractException : Exception
FrameworkFork\System.ServiceModel\System\ServiceModel\QuotaExceededException.cs (1)
10public class QuotaExceededException : Exception
Metadata\MetadataExchangeException.cs (1)
14public class MetadataExchangeException : Exception
Shared\Utilities\ProcessRunner.cs (1)
19public class ProcessException : Exception
ToolRuntimeException.cs (1)
9internal class ToolRuntimeException : Exception
dotnet-user-jwts (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
dotnet-user-secrets (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
GetDocument.Insider (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
364private sealed class HostAbortedException : Exception
CommandException.cs (1)
8internal sealed class CommandException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
http2cat (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IIS.FunctionalTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IIS.LongTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IIS.NewHandler.FunctionalTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IIS.NewShim.FunctionalTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IIS.ShadowCopy.Tests (2)
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
IISExpress.FunctionalTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
illink (2)
Microsoft.Analyzers.Local (1)
ApiLifecycle\Json\JsonParseException.cs (1)
17public sealed class JsonParseException : Exception
Microsoft.AspNetCore.Antiforgery (1)
AntiforgeryValidationException.cs (1)
9public class AntiforgeryValidationException : Exception
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationFailureException.cs (1)
9public class AuthenticationFailureException : Exception
Microsoft.AspNetCore.Components (4)
LocationChangeException.cs (1)
9public sealed class LocationChangeException : Exception
NavigationException.cs (1)
9public class NavigationException : Exception
src\Http\Routing\src\Patterns\RoutePatternException.cs (1)
16internal sealed class RoutePatternException : Exception
src\Http\Routing\src\RouteCreationException.cs (1)
12internal class RouteCreationException : Exception
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\FormDataMappingException.cs (1)
6internal class FormDataMappingException : Exception
Microsoft.AspNetCore.Components.Server (1)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackSerializationException.cs (1)
17class MessagePackSerializationException : Exception
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
Microsoft.AspNetCore.Diagnostics.Tests (1)
DeveloperExceptionPageMiddlewareTest.cs (1)
639public class CustomCompilationException : Exception, ICompilationException
Microsoft.AspNetCore.Http.Connections.Client (2)
NoTransportSupportedException.cs (1)
11public class NoTransportSupportedException : Exception
TransportFailedException.cs (1)
11public class TransportFailedException : Exception
Microsoft.AspNetCore.Http.Extensions (1)
src\Components\Endpoints\src\FormMapping\FormDataMappingException.cs (1)
6internal class FormDataMappingException : Exception
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
980private sealed class IdentityResultException : Exception
Microsoft.AspNetCore.JsonPatch (1)
Exceptions\JsonPatchException.cs (1)
9public class JsonPatchException : Exception
Microsoft.AspNetCore.Mvc.Abstractions (3)
Formatters\InputFormatterException.cs (1)
9public class InputFormatterException : Exception
ModelBinding\TooManyModelErrorsException.cs (1)
9public class TooManyModelErrorsException : Exception
ModelBinding\ValueProviderException.cs (1)
9public sealed class ValueProviderException : Exception
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelStateDictionaryTest.cs (1)
1767internal class TestException : Exception
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\UnsupportedContentTypeException.cs (1)
12public class UnsupportedContentTypeException : Exception
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedException.cs (1)
9internal sealed class CompilationFailedException : Exception, ICompilationException
Microsoft.AspNetCore.Mvc.Testing (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
364private sealed class HostAbortedException : Exception
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheTests.cs (1)
966sealed class SomeException : Exception { }
Microsoft.AspNetCore.Routing (3)
Matching\AmbiguousMatchException.cs (1)
12internal sealed class AmbiguousMatchException : Exception
Patterns\RoutePatternException.cs (1)
14public sealed class RoutePatternException : Exception
RouteCreationException.cs (1)
10public class RouteCreationException : Exception
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
Microsoft.AspNetCore.Server.Kestrel.Core (12)
Internal\Http2\Http2StreamErrorException.cs (1)
6internal sealed class Http2StreamErrorException : Exception
Internal\Http3\Http3ConnectionErrorException.cs (1)
8internal sealed class Http3ConnectionErrorException : Exception
Internal\Http3\Http3PendingStreamException.cs (1)
6internal sealed class Http3PendingStreamException : Exception
Internal\Http3\Http3StreamErrorException.cs (1)
8internal sealed class Http3StreamErrorException : Exception
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\runtime\Http3\QPack\QPackDecodingException.cs (1)
10internal sealed class QPackDecodingException : Exception
src\Shared\runtime\Http3\QPack\QPackEncodingException.cs (1)
10internal sealed class QPackEncodingException : Exception
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
Microsoft.AspNetCore.Shared.Tests (8)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\Shared\runtime\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\Shared\runtime\Http3\QPack\QPackDecodingException.cs (1)
10internal sealed class QPackDecodingException : Exception
src\Shared\runtime\Http3\QPack\QPackEncodingException.cs (1)
10internal sealed class QPackEncodingException : Exception
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (1)
8internal sealed class Http2ConnectionErrorException : Exception
src\Shared\ServerInfrastructure\Http2\Http2SettingsParameterOutOfRangeException.cs (1)
8internal sealed class Http2SettingsParameterOutOfRangeException : Exception
Microsoft.AspNetCore.SignalR.Common (1)
HubException.cs (1)
17public class HubException : Exception
Microsoft.AspNetCore.TestHost (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
364private sealed class HostAbortedException : Exception
HttpResetTestException.cs (1)
11public class HttpResetTestException : Exception
Microsoft.Build (1)
BuildCheck\Infrastructure\BuildCheckConfigurationException.cs (1)
8internal sealed class BuildCheckConfigurationException : Exception
Microsoft.Build.Framework (1)
BuildException\BuildExceptionBase.cs (1)
14public abstract class BuildExceptionBase : Exception
Microsoft.Build.Tasks.Core (9)
AssemblyDependency\BadImageReferenceException.cs (1)
15internal sealed class BadImageReferenceException : Exception
AssemblyDependency\DependencyResolutionException.cs (1)
15internal sealed class DependencyResolutionException : Exception
AssemblyDependency\InvalidReferenceAssemblyNameException.cs (1)
16internal sealed class InvalidReferenceAssemblyNameException : Exception
AssemblyDependency\ReferenceResolutionException.cs (1)
15internal sealed class ReferenceResolutionException : Exception
GenerateResource.cs (1)
3979internal sealed class TextFileException : Exception
InvalidParameterValueException.cs (1)
18internal sealed class InvalidParameterValueException : Exception
ResourceHandling\InputFormatNotSupportedException.cs (1)
12internal class InputFormatNotSupportedException : Exception
ResourceHandling\MSBuildResXException.cs (1)
12internal class MSBuildResXException : Exception
ResourceHandling\PreserializedResourceWriterRequiredException.cs (1)
12internal sealed class PreserializedResourceWriterRequiredException : Exception
Microsoft.CodeAnalysis (9)
CodeGen\PermissionSetAttribute.cs (1)
190internal class PermissionSetFileReadException : Exception
DiaSymReader\Writer\SymUnmanagedWriterException.cs (1)
14internal sealed class SymUnmanagedWriterException : Exception
MetadataReader\UnsupportedSignatureContent.cs (1)
11: Exception
PEWriter\PeWriter.cs (1)
27internal sealed class PeWritingException : Exception
ResourceException.cs (1)
9internal sealed class ResourceException : Exception
RuleSet\InvalidRuleSetException.cs (1)
14internal class InvalidRuleSetException : Exception
SourceGeneration\UserFunction.cs (1)
14internal sealed class UserFunctionException : Exception
StrongName\DesktopStrongNameProvider.cs (1)
32internal sealed class ClrStrongNameMissingException : Exception
Syntax\SyntaxNode.cs (1)
1404private protected sealed class SerializationDeprecationException : Exception
Microsoft.CodeAnalysis.CSharp (4)
Binder\PatternExplainer.cs (1)
21private class NoRemainingValuesException : Exception { }
BoundTree\BoundTreeVisitors.cs (1)
163public class CancelledByStackGuardException : Exception
CodeGen\EmitExpression.cs (1)
26private class EmitCancelledException : Exception
Lowering\SyntheticBoundNodeFactory.cs (1)
34public class MissingPredefinedMember : Exception
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
EditAndContinue\ActiveStatementTests.cs (1)
12577private class SimpleToStringException : Exception
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\ReferenceManagerTests.cs (1)
1295private class TestException : Exception
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
NotImplementedMetadataException.cs (1)
11internal sealed class NotImplementedMetadataException : Exception
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (2)
CSharp\MemberSignatureParser.cs (1)
329private sealed class InvalidSignatureException : Exception
VisualBasic\MemberSignatureParser.cs (1)
369private sealed class InvalidSignatureException : Exception
Microsoft.CodeAnalysis.Scripting (1)
CompilationErrorException.cs (1)
15public sealed class CompilationErrorException : Exception
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
ObjectFormatterFixtures\Custom.cs (1)
348internal class MyException : Exception
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\Exceptions.cs (2)
16public class EmitException : Exception 34public class ExecutionException : Exception
Diagnostics\ThrowingDiagnosticAnalyzer.cs (1)
26public class DeliberateException : Exception
Microsoft.CodeAnalysis.Workspaces (2)
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (1)
132private sealed class NonEquivalentTreeException : Exception
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
997public class CompilationTrackerValidationException : Exception
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Rpc\RemoteInvocationException.cs (1)
9internal sealed class RemoteInvocationException : Exception
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\TaskExtensionsTests.cs (1)
31private class TestException : Exception { }
Microsoft.CSharp (4)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (2)
19internal sealed class DynamicBindingFailedException : Exception 468internal sealed class DynamicDebugViewEmptyException : Exception
Microsoft\CSharp\RuntimeBinder\RuntimeBinderException.cs (1)
16public class RuntimeBinderException : Exception
Microsoft\CSharp\RuntimeBinder\RuntimeBinderInternalCompilerException.cs (1)
16public class RuntimeBinderInternalCompilerException : Exception
Microsoft.DotNet.Helix.Client (1)
generated-code\HelixApi.cs (1)
307public partial class RestApiException : Exception
Microsoft.DotNet.RemoteExecutor (2)
RemoteExecutionException.cs (1)
13public sealed class RemoteExecutionException : Exception
RemoteExecutionTimeoutException.cs (1)
8public sealed class RemoteExecutionTimeoutException : Exception
Microsoft.DotNet.VersionTools (2)
Automation\GitHubApi\NotFastForwardUpdateException.cs (1)
8public class NotFastForwardUpdateException : Exception
BuildManifest\ManifestChangeOutOfDateException.cs (1)
8public class ManifestChangeOutOfDateException : Exception
Microsoft.DotNet.XliffTasks (1)
Tasks\BuildErrorException.cs (1)
8internal sealed class BuildErrorException : Exception
Microsoft.DotNet.XUnitExtensions (3)
ConditionalDiscovererException.cs (1)
8internal class ConditionalDiscovererException : Exception
DesktopTraceListener.cs (1)
23private sealed class DebugAssertException : Exception
SkippedTestMessageBus.cs (1)
11public class SkipTestException : Exception
Microsoft.Extensions.Caching.Hybrid.Tests (1)
SizeTests.cs (1)
268public class KnownFailureException : Exception
Microsoft.Extensions.Hosting.Abstractions (1)
HostAbortedException.cs (1)
12public sealed class HostAbortedException : Exception
Microsoft.Extensions.Options (1)
OptionsValidationException.cs (1)
12public class OptionsValidationException : Exception
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Microsoft.Gen.Metrics\Exceptions\TransitiveTypeCycleException.cs (1)
11internal sealed class TransitiveTypeCycleException : Exception
Microsoft.Gen.Metrics (1)
Exceptions\TransitiveTypeCycleException.cs (1)
11internal sealed class TransitiveTypeCycleException : Exception
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Exceptions\TransitiveTypeCycleException.cs (1)
11internal sealed class TransitiveTypeCycleException : Exception
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\UnreachableException.cs (1)
13internal sealed class UnreachableException : Exception
Microsoft.Interop.JavaScript.JSImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\UnreachableException.cs (1)
13internal sealed class UnreachableException : Exception
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\UnreachableException.cs (1)
13internal sealed class UnreachableException : Exception
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\System.Runtime.InteropServices\gen\Common\UnreachableException.cs (1)
13internal sealed class UnreachableException : Exception
Microsoft.Interop.SourceGeneration (2)
MarshallingInfoParser.cs (1)
354private sealed class CyclicalElementInfoException : Exception
src\libraries\System.Runtime.InteropServices\gen\Common\UnreachableException.cs (1)
13internal sealed class UnreachableException : Exception
Microsoft.JSInterop (2)
JSDisconnectedException.cs (1)
9public sealed class JSDisconnectedException : Exception
JSException.cs (1)
9public class JSException : Exception
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewInvokeJavaScriptException.cs (1)
5internal class HybridWebViewInvokeJavaScriptException : Exception
Platform\HandlerNotFoundException.cs (1)
8 class HandlerNotFoundException : System.Exception
Microsoft.Maui.Controls (4)
Internals\ImageParser.cs (1)
11 public class GIFDecoderFormatException : Exception
InvalidNavigationException.cs (1)
9 public class InvalidNavigationException : Exception
UnsolvableConstraintsException.cs (1)
8 public class UnsolvableConstraintsException : Exception
XamlParseException.cs (1)
9 public class XamlParseException : Exception
Microsoft.Maui.Controls.Build.Tasks (1)
BuildException.cs (1)
8 class BuildException : Exception
Microsoft.Maui.Controls.SourceGen (1)
src\Controls\src\Core\XamlParseException.cs (1)
9 public class XamlParseException : Exception
Microsoft.ML.AutoML (1)
API\InferenceException.cs (1)
28public sealed class InferenceException : Exception
Microsoft.ML.FastTree (1)
Training\TreeLearners\TreeLearner.cs (1)
43internal class TreeLearnerException : Exception
Microsoft.ML.StandardTrainers (1)
Optimizer\Optimizer.cs (1)
79public abstract class OptimizerException : Exception
Microsoft.TestUtilities (1)
XUnit\SkipTestException.cs (1)
10public class SkipTestException : Exception
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\CompilerServices\IncompleteInitialization.vb (1)
8Inherits Global.System.Exception
Microsoft\VisualBasic\FileIO\MalformedLineException.vb (1)
18Inherits Exception
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\CPS\IWorkspaceProjectContextFactory.cs (1)
115internal sealed class InvalidProjectDataException : Exception
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
469private class LiveShareTextBufferMissingException : Exception
MSBuild (2)
CommandLineSwitchException.cs (1)
20internal sealed class CommandLineSwitchException : Exception
InitializationException.cs (1)
25internal sealed class InitializationException : Exception
MSBuildTaskHost (1)
BuildExceptionBase.cs (1)
14public abstract class BuildExceptionBase : Exception
PresentationBuildTasks (2)
MS\Internal\MarkupCompiler\AssemblyVersionParseException.cs (1)
13internal class AssemblyVersionParseException : Exception
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (1)
2689private class MappingParseError : Exception
PresentationCore (1)
System\Windows\dataobject.cs (1)
3262private class RestrictedTypeDeserializationException : Exception
PresentationFramework (4)
MS\Internal\PtsHost\Pts.cs (2)
265private class SecondaryException : Exception 300private class PtsException : Exception
System\Windows\Controls\PrintDialogException.cs (1)
14public class PrintDialogException : Exception
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (1)
310internal class RetriesExhaustedException : Exception
PresentationUI (1)
MS\Internal\Documents\Application\XpsViewerException.cs (1)
20internal class XpsViewerException : Exception
ReachFramework (1)
Exceptions\XpsException.cs (1)
14public class XpsException : Exception
Swaggatherer (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\ValidationException.cs (1)
14public class ValidationException : Exception
System.ComponentModel.Composition (4)
System\ComponentModel\Composition\CompositionContractMismatchException.cs (1)
15public class CompositionContractMismatchException : Exception
System\ComponentModel\Composition\CompositionException.cs (1)
22public class CompositionException : Exception
System\ComponentModel\Composition\ImportCardinalityMismatchException.cs (1)
18public class ImportCardinalityMismatchException : Exception
System\ComponentModel\Composition\Primitives\ComposablePartException.cs (1)
17public class ComposablePartException : Exception
System.Composition.Runtime (1)
System\Composition\Hosting\CompositionFailedException.cs (1)
11public class CompositionFailedException : Exception
System.Configuration.ConfigurationManager (4)
System\Configuration\Provider\ProviderException.cs (1)
11public class ProviderException : Exception
System\Configuration\SettingsPropertyIsReadOnlyException.cs (1)
11public class SettingsPropertyIsReadOnlyException : Exception
System\Configuration\SettingsPropertyNotFoundException.cs (1)
11public class SettingsPropertyNotFoundException : Exception
System\Configuration\SettingsPropertyWrongTypeException.cs (1)
11public class SettingsPropertyWrongTypeException : Exception
System.Diagnostics.EventLog (1)
artifacts\obj\System.Diagnostics.EventLog\Debug\net10.0\System.Diagnostics.EventLog.notsupported.cs (1)
226public partial class EventLogException : System.Exception
System.DirectoryServices (4)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (4)
539public partial class ActiveDirectoryObjectExistsException : System.Exception 550public partial class ActiveDirectoryObjectNotFoundException : System.Exception, System.Runtime.Serialization.ISerializable 569public partial class ActiveDirectoryOperationException : System.Exception, System.Runtime.Serialization.ISerializable 743public partial class ActiveDirectoryServerDownException : System.Exception, System.Runtime.Serialization.ISerializable
System.DirectoryServices.Protocols (1)
artifacts\obj\System.DirectoryServices.Protocols\Debug\net10.0\System.DirectoryServices.Protocols.notsupported.cs (1)
194public partial class DirectoryException : System.Exception
System.Formats.Asn1 (1)
System\Formats\Asn1\AsnContentException.cs (1)
13public class AsnContentException : Exception
System.Formats.Cbor (1)
System\Formats\Cbor\CborContentException.cs (1)
11public class CborContentException : Exception
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageException.cs (1)
12public class IsolatedStorageException : Exception, ISerializable
System.Linq (1)
System\Linq\DebugView.cs (1)
53internal sealed class SystemCore_EnumerableDebugViewEmptyException : Exception
System.Linq.Expressions (1)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
200internal sealed class RethrowException : Exception
System.Net.Http (7)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs (1)
11internal sealed class HPackDecodingException : Exception
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs (1)
6internal sealed class HPackEncodingException : Exception
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs (1)
11internal sealed class HuffmanDecodingException : Exception, ISerializable
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs (1)
10internal sealed class QPackDecodingException : Exception
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs (1)
10internal sealed class QPackEncodingException : Exception
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System\Net\Http\HttpRequestException.cs (1)
6public class HttpRequestException : Exception
System.Net.Mail (2)
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System\Net\Mail\SmtpException.cs (1)
11public class SmtpException : Exception
System.Net.NameResolution (1)
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System.Net.Requests (1)
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System.Net.Security (3)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (1)
13internal sealed class GssApiException : Exception
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
935internal sealed class SslException : Exception
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System.Net.Sockets (1)
src\libraries\Common\src\System\Net\InternalException.cs (1)
8internal sealed class InternalException : Exception
System.Private.CoreLib (13)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
24public class AggregateException : Exception
src\libraries\System.Private.CoreLib\src\System\ApplicationException.cs (1)
20public class ApplicationException : Exception
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractException.cs (1)
12public sealed class ContractException : Exception
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.cs (1)
77private sealed class DebugAssertException : Exception
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSourceException.cs (1)
14public class EventSourceException : Exception
src\libraries\System.Private.CoreLib\src\System\Diagnostics\UnreachableException.cs (1)
9public sealed class UnreachableException : Exception
src\libraries\System.Private.CoreLib\src\System\InvalidTimeZoneException.cs (1)
12public class InvalidTimeZoneException : Exception
src\libraries\System.Private.CoreLib\src\System\Runtime\AmbiguousImplementationException.cs (1)
11public sealed class AmbiguousImplementationException : Exception
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeWrappedException.cs (1)
14public sealed class RuntimeWrappedException : Exception
src\libraries\System.Private.CoreLib\src\System\SystemException.cs (1)
12public class SystemException : Exception
src\libraries\System.Private.CoreLib\src\System\Threading\LockRecursionException.cs (1)
12public class LockRecursionException : Exception
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskSchedulerException.cs (1)
24public class TaskSchedulerException : Exception
src\libraries\System.Private.CoreLib\src\System\TimeZoneNotFoundException.cs (1)
12public class TimeZoneNotFoundException : Exception
System.Private.Windows.Core (1)
System\Private\Windows\Ole\RestrictedTypeDeserializationException.cs (1)
10internal class RestrictedTypeDeserializationException : Exception
System.Private.Xml (2)
System\Xml\Schema\ContentValidator.cs (1)
18internal sealed class UpaException : Exception
System\Xml\Serialization\CodeGenerator.cs (1)
1625internal sealed class CodeGeneratorConversionException : Exception
System.Reflection.Metadata (2)
System\Reflection\Metadata\ImageFormatLimitationException.cs (1)
8public partial class ImageFormatLimitationException : Exception
System\Reflection\Metadata\ImageFormatLimitationException.Serialization.cs (1)
11public partial class ImageFormatLimitationException : Exception
System.Runtime.InteropServices.JavaScript (1)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net10.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (1)
137public sealed class JSException : Exception
System.Runtime.Serialization.Primitives (1)
System\Runtime\Serialization\InvalidDataContractException.cs (1)
12public class InvalidDataContractException : Exception
System.ServiceModel.Primitives (4)
netstandard.cs (4)
373public class SecurityTokenException : System.Exception 579public partial class CommunicationException : System.Exception 846public partial class InvalidMessageContractException : System.Exception 990public partial class QuotaExceededException : System.Exception
System.Text.Json (1)
System\Text\Json\JsonException.cs (1)
14public class JsonException : Exception
System.Threading (1)
System\Threading\Barrier.cs (1)
26public class BarrierPostPhaseException : Exception
System.Windows.Forms (1)
System\Windows\Forms\ActiveX\AxHost.InvalidActiveXStateException.cs (1)
8public class InvalidActiveXStateException : Exception
System.Windows.Forms.Design (1)
System\ComponentModel\Design\ExceptionCollection.cs (1)
9public sealed class ExceptionCollection : Exception
System.Xaml (2)
System\Xaml\Parser\GenericTypeNameParser.cs (1)
15class TypeNameParserException : Exception
System\Xaml\XamlException.cs (1)
13public class XamlException : Exception
Templates.Blazor.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
Templates.Blazor.WebAssembly.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
Templates.Mvc.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
Templates.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1253internal sealed class UserCancelledTrustException : Exception
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
UIAutomationTypes (2)
System\Windows\Automation\NoClickablePointException.cs (1)
20public class NoClickablePointException : Exception
System\Windows\Automation\ProxyAssemblyNotLoadedException.cs (1)
25public class ProxyAssemblyNotLoadedException : Exception
Wasm.Performance.ConsoleHost (1)
src\Shared\CommandLineUtils\CommandLine\CommandParsingException.cs (1)
8internal sealed class CommandParsingException : Exception
XmlFileLogger (1)
UnknownTaskParameterPrefixException.cs (1)
10internal sealed class UnknownTaskParameterPrefixException : Exception
xunit.assert (2)
Sdk\AssertEqualityComparer.cs (1)
107 public sealed class OperationalFailureException : Exception
Sdk\Exceptions\XunitException.cs (1)
28 partial class XunitException : Exception, IAssertionException
xunit.console (1)
common\Json.cs (1)
549class JsonDeserializerException : Exception
1117 instantiations of Exception
BasicWebSite (3)
Controllers\AuthorizeUserController.cs (1)
27throw new Exception("Shouldn't be invoked.");
Controllers\CustomServiceApiController.cs (1)
45throw new Exception("Service should not have been resolved");
Controllers\FiltersController.cs (1)
16throw new Exception("Shouldn't be executed");
BuildBoss (4)
CompilerNuGetCheckerUtil.cs (2)
431return file ?? throw new Exception($"Unable to find unique '{partialName}' in '{directory}'"); 439return file ?? throw new Exception($"Unable to find '{fileName}' in '{directory}'");
SolutionCheckerUtil.cs (1)
120default: throw new Exception($"Invalid file path {data.FilePath}");
SolutionUtil.cs (1)
76throw new Exception($"Invalid project line {line}");
BuildValidator (3)
CompilationDiff.cs (1)
222throw new Exception($"Unexpected value {Result}");
LocalReferenceResolver.cs (1)
114throw new Exception($"Could not find referenced assembly {referenceInfo}");
LocalSourceResolver.cs (1)
54throw new Exception($@"File ""{onDiskPath}"" has incorrect hash");
ClassLibraryWithPortablePdbs (2)
ExceptionType.cs (2)
10throw new Exception(); 15throw new Exception();
Client.ExpectedExceptions.IntegrationTests (1)
ExpectedExceptionTests.4.0.0.cs (1)
403throw new Exception(exceptionMsg);
Contract.Fault.IntegrationTests (1)
FaultExceptionTests.cs (1)
78throw new Exception("Expected TestFaultWithKnownType in the ClientOperations, Actual: TestFaultWithKnownType NOT Found");
csc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
270throw new Exception(message, e);
DefaultBuilder.SampleApp (1)
Program.cs (1)
47.MapGet("throw/{message?}", (req, res, data) => throw new Exception((string)data.Values["message"] ?? "Uh oh!"))
DeveloperExceptionPageSample (1)
Startup.cs (1)
40throw new Exception(string.Concat(
Diagnostics.EFCore.FunctionalTests (10)
DatabaseErrorPageMiddlewareTest.cs (8)
126throw new Exception("SaveChanges should have thrown"); 161throw new Exception("SaveChanges should have thrown"); 226throw new Exception("SaveChanges should have thrown"); 266throw new Exception("SaveChanges should have thrown"); 429throw new Exception("SaveChanges should have thrown"); 472throw new Exception("SaveChanges should have thrown"); 508throw new Exception("SaveChanges should have thrown"); 512throw new Exception("I wrapped your exception", ex);
TestModels\BloggingContextWithSnapshotThatThrows.cs (2)
22throw new Exception("Welcome to the invalid snapshot!"); 34throw new Exception("Welcome to the invalid migration!");
dotnet-svcutil-lib (23)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (2)
3220throw new Exception("Prefix not interned: \'" + decl.prefix + "\'"); 3222throw new Exception("Uri not interned: \'" + decl.uri + "\'");
FrameworkFork\Microsoft.Xml\Xml\Core\util\TernaryTreeGenerator.cs (4)
239throw new Exception("Too many characters have been added"); 260throw new Exception("Too many characters have been added"); 308throw new Exception("String table not correctly sorted"); 329throw new Exception("String table not correctly sorted");
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (3)
470throw new Exception("If conversion from " + tSrc.Name + " to " + tDst.Name + " exists, a default conversion should also be defined."); 1002throw new Exception("Unknown type " + name); 1057throw new Exception("Internal error: Unable to seek/read/write this filestream");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCustomFormatter.cs (2)
59throw new Exception(string.Format(ResXml.XmlUnsupportedDefaultType, type.FullName)); 206throw new Exception(string.Format(ResXml.XmlUnsupportedDefaultValue, formatter));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (2)
439throw new Exception("SocketConnection.EndWrite called with no write pending."); 742throw new Exception("SocketConnection.EndRead called with no read pending.");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (2)
473throw new Exception("invalid framing client state machine"); 513throw new Exception("invalid framing client state machine");
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (2)
136throw new Exception("Receive: DecodeMessage() should consume the outstanding buffer or return a message."); 194throw new Exception("Receive: DecodeMessage() should consume the outstanding buffer or return a message.");
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptions.cs (1)
109return new Exception(string.Format(ResWebServices.WebDescriptionMissingItem, type, name.Name, name.Namespace));
Shared\MSBuildProj.cs (4)
183throw new Exception(Shared.Resources.ErrorInvalidProjectFormat); 329throw new Exception(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorProjectReferenceMissingFilePathFormat, binReference)); 484throw new Exception(Shared.Resources.ErrorInvalidProjectFormat); 511throw new Exception(Shared.Resources.ErrorInvalidProjectFormat);
Shared\TargetFrameworkHelper.cs (1)
128throw new Exception(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorNotSupportedTargetFrameworkFormat,
ErrorCustomCheck (3)
ErrorOnInitializeCheck.cs (1)
27throw new Exception("Something went wrong initializing");
ErrorOnRegisteredAction.cs (1)
36throw new Exception("something went wrong when executing registered action");
ErrorWhenRegisteringActions.cs (1)
32throw new Exception("something went wrong when registering actions");
ExceptionHandlerSample (2)
Startup.cs (1)
42throwApp.Run(context => { throw new Exception("Application Exception"); });
StartupWithProblemDetails.cs (1)
24throwApp.Run(_ => throw new Exception("Application Exception"));
GenerateRulesMissingDocumentation (1)
Program.cs (1)
150throw new Exception($"'{path}' does not exist");
http2cat (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
HttpStress (7)
Program.cs (7)
103throw new Exception($"Expected response version {expectedVersion}, got {m.Version}"); 111throw new Exception($"Expected response content \"{expectedContent}\", got \"{actualContent}\""); 126throw new Exception("Completed unexpectedly"); 331throw new Exception($"Expected {maxContentLength}, got {m.Content.Headers.ContentLength}"); 336throw new Exception($"Got unexpected response: {r}"); 354throw new Exception($"Got unexpected response: {r}"); 620throw new Exception("There was a failure in the stress run. See logs for exact time of failure");
IdeBenchmarks (2)
Lsp\LspCompletionSerializationBenchmarks.cs (2)
121throw new System.Exception(); 164throw new System.Exception();
IdeCoreBenchmarks (1)
FindReferencesBenchmarks.cs (1)
100throw new Exception("Couldn't find type");
IIS.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
IIS.LongTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
IIS.NewHandler.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
IIS.NewShim.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
IISExpress.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
37throw new Exception($"Server not started successfully, recieved non success status code, responseText: {responseText}");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
InMemory.FunctionalTests (35)
ChunkedRequestTests.cs (1)
1090httpContext.Request.BodyReader.Complete(new Exception());
ChunkedResponseTests.cs (2)
428throw new Exception(); 461throw new Exception();
Http2\Http2ConnectionTests.cs (1)
5338var exception = new Exception();
Http2\Http2StreamTests.cs (7)
1760throw new Exception(); 1794throw new Exception(); 3101throw new Exception("App Faulted"); 3135throw new Exception("App Faulted"); 3255_runningStreams[streamIdFeature.StreamId].TrySetException(new Exception("ReadAsync was expected to throw.")); 3298_runningStreams[streamIdFeature.StreamId].TrySetException(new Exception("ReadAsync was expected to throw.")); 4695var expectedException = new Exception();
Http2\Http2WebSocketTests.cs (1)
613throw new Exception("ConnectProtocol should be null here. The fact that it is not indicates that we are not resetting properly between requests.");
Http3\WebTransport\WebTransportHandshakeTests.cs (2)
149_ => throw new Exception("Core string not mapped yet") 163_ => throw new Exception("Header name not mapped yet")
KestrelMetricsTests.cs (1)
981throw new Exception($"Connection has unexpected error.type value: {measurement.Tags["error.type"]}", ex);
RequestTests.cs (1)
2048httpContext.Request.BodyReader.Complete(new Exception());
ResponseTests.cs (13)
50throw new Exception(); 285throw new Exception(); 315throw new Exception(); 377context.Response.OnCompleted(_ => throw new Exception(), null); 2435throw new Exception(); 2479var onStartingException = new Exception(); 2634throw new Exception(); 2639throw new Exception(); 2691throw new Exception(); 2736throw new Exception(); 3080var expectedException = new Exception(); 3108var expectedException = new Exception(); 4113var expectedException = new Exception();
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
578throw new Exception("Reader didn't complete with frame");
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
84throw new Exception($"Couldn't find a free port after {startingPort}.");
src\Servers\Kestrel\shared\test\StreamExtensions.cs (1)
67throw new Exception("Stream read 0.");
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (2)
185throw new Exception("Failed to set local and remote ip addresses"); 387throw new Exception();
InteractiveHost.UnitTests (2)
InteractiveHostDesktopTests.cs (2)
979Assert.True(error.StartsWith($"{new Exception().GetType()}: {new Exception().Message}"));
Interop.FunctionalTests (7)
H2SpecCommands.cs (1)
291throw new Exception(string.Join(Environment.NewLine, failures));
Http3\Http3RequestTests.cs (2)
1392throw new Exception($"Error checking trailer {i}", ex); 1930throw new Exception($"Wait for logs failure: {message}");
HttpClientHttp2InteropTests.cs (1)
511_sendComplete.TrySetException(new Exception("Abort"));
HttpHelpers.cs (1)
35throw new Exception($"Couldn't find {nameof(HttpProtocolException)}. Original error: {ex}");
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
84throw new Exception($"Couldn't find a free port after {startingPort}.");
src\Servers\Kestrel\shared\test\StreamExtensions.cs (1)
67throw new Exception("Stream read 0.");
Microsoft.Arcade.Common (1)
CommandResult.cs (1)
46throw new Exception(message.ToString());
Microsoft.Arcade.Test.Common (1)
AssertEx.cs (1)
394throw new Exception("No exception was thrown.");
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTest.cs (1)
172.Throws(new Exception("should be swallowed"));
Microsoft.AspNetCore.App.Analyzers.Test (9)
RouteEmbeddedLanguage\RoutePatternBraceMatcherTests.cs (2)
197throw new Exception("No result doesn't match spans."); 202throw new Exception("Not found.");
RouteEmbeddedLanguage\RoutePatternHighlighterTests.cs (2)
463throw new Exception($"Couldn't find {span.TextSpan} in highlight results."); 469throw new Exception($"Unmatched highlight spans in document: {string.Join(", ", tempSpans)}");
RouteEmbeddedLanguage\RoutePatternParserTests.cs (4)
174throw new Exception($"Parsing '{token.ValueText}' throws RoutePattern error '{ex.Message}'. No diagnostics.", ex); 223throw new Exception($"Couldn't find parameter '{parsedRoutePattern.Name}'."); 228throw new Exception($"Parsing '{token.ValueText}' has route parameter '{parsedRoutePattern.Name}' mismatch.", ex); 364throw new Exception($"When checking '{allChars.CreateString()}' there was a mismatch between '{allCharsString}' and '{virtualCharsString}' at index {i}.", ex);
RouteEmbeddedLanguage\RoutePatternParserTests_ConformanceTests.cs (1)
842throw new Exception($"Couldn't find expected route parameter: {expectedName}");
Microsoft.AspNetCore.Authentication.Negotiate.Test (6)
EventTests.cs (3)
574ex = new Exception("A test credential error occurred"); 578ex = new Exception("A test client error occurred"); 582ex = new Exception("A test other error occurred");
NegotiateHandlerTests.cs (3)
598ex = new Exception("A test credential error occurred"); 602ex = new Exception("A test client error occurred"); 606ex = new Exception("A test other error occurred");
Microsoft.AspNetCore.Authentication.Test (9)
CookieTests.cs (1)
1866throw new Exception("Failed to authenticate", result.Failure);
JwtBearerTests.cs (4)
185throw new Exception(); 703throw new Exception("Test Exception"); 737throw new Exception("Test Exception"); 1179throw new Exception("Failed to authenticate", result.Failure);
JwtBearerTests_Handler.cs (4)
175throw new Exception(); 658throw new Exception("Test Exception"); 689throw new Exception("Test Exception"); 1246throw new Exception("Failed to authenticate", result.Failure);
Microsoft.AspNetCore.Components.Tests (8)
RendererTest.cs (7)
701OnTest = args => throw new Exception("Error") 2270var exception1 = new Exception(); 2271var exception2 = new Exception(); 2547var exception1 = new Exception(); 2548var exception2 = new Exception(); 4236var exception1 = new Exception(); 4237var exception2 = new Exception();
Routing\RouterTest.cs (1)
67throw new Exception("This is an uncaught exception.");
Microsoft.AspNetCore.Components.WebView.Test (8)
Infrastructure\ContainerNode.cs (1)
40throw new Exception("Not implemented: inserting non-empty logical container");
Infrastructure\TestDocument.cs (7)
105throw new Exception("Cannot set attribute on non-element child"); 129throw new Exception("Cannot remove attribute from non-element child"); 145throw new Exception("Cannot set text content on non-text child"); 192throw new Exception($"Unknown edit type: '{edit.Type}'"); 216throw new Exception("Attribute frames should only be present as leading children of element frames."); 238throw new Exception("Reference capture frames can only be children of element frames."); 250throw new Exception($"Unknown frame type: {frame.FrameType}");
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
TaskExtensions.cs (1)
19throw new Exception("Unreachable code");
Microsoft.AspNetCore.Cors.Test (2)
CorsMiddlewareTests.cs (2)
602throw new Exception("Runtime error"); 750c => { throw new Exception("Should not be called."); },
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
TimeLimitedDataProtectorTests.cs (1)
139mockInnerProtector.Setup(o => o.CreateProtector(TimeLimitedPurposeString).Unprotect(new byte[] { 0x10, 0x11 })).Throws(new Exception("How exceptional!"));
Microsoft.AspNetCore.DataProtection.Tests (3)
KeyManagement\DefaultKeyResolverTests.cs (1)
468mockKey.Setup(o => o.CreateEncryptor()).Throws(new Exception("This method fails."));
KeyManagement\DeferredKeyTests.cs (1)
68throw new Exception("How exceptional.");
KeyManagement\KeyRingProviderTests.cs (1)
734mockCacheableKeyRingProvider.Setup(o => o.GetCacheableKeyRing(throwKeyRingTime)).Throws(new Exception("How exceptional."));
Microsoft.AspNetCore.Diagnostics.Tests (18)
DeveloperExceptionPageMiddlewareTest.cs (11)
53throw new Exception("Test exception"); 106throw new Exception("Test exception"); 165throw new Exception("Test exception"); 208throw new Exception("Test exception"); 243throw new Exception("Test exception"); 280throw new Exception("Test exception"); 318throw new Exception("Test exception"); 390throw new Exception("Test exception"); 426throw new Exception("Test exception"); 464throw new Exception("Test exception"); 596throw new Exception("Test exception");
ExceptionHandlerMiddlewareTest.cs (3)
59throw new Exception("Test exception"); 327throw new Exception("Test exception"); 394throw new Exception("Test exception");
ExceptionHandlerTest.cs (4)
479throw new Exception("Test exception"); 1018throw new Exception("Test exception"); 1088throw new Exception("Test exception1"); 1151throw new Exception("Test exception1");
Microsoft.AspNetCore.FunctionalTests (1)
WebHostFunctionalTests.cs (1)
250throw new Exception($"Solution root could not be found using {applicationBasePath}");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
ServerStreamingServerCallHandlerTests.cs (3)
92throw new Exception("Exception!"); 130var debugException = new Exception("Error!"); 174return Task.FromException<HelloReply>(new Exception("Exception!"));
UnaryServerCallHandlerTests.cs (1)
849var debugException = new Exception("Error!");
Microsoft.AspNetCore.Hosting.Tests (8)
ConfigureBuilderTests.cs (1)
47throw new Exception("Service instantiation failed");
Fakes\StartupConfigureServicesThrows.cs (1)
13throw new Exception("Exception from ConfigureServices");
Fakes\StartupConfigureThrows.cs (1)
17throw new Exception("Exception from Configure");
Fakes\StartupCtorThrows.cs (1)
12throw new Exception("Exception from constructor");
Fakes\StartupStaticCtorThrows.cs (1)
12throw new Exception("Exception from static constructor");
HostingApplicationDiagnosticsTests.cs (3)
203throw new Exception("Unexpected measurement count."); 676hostingApplication.DisposeContext(context, new Exception()); 698hostingApplication.DisposeContext(context, new Exception());
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
GetHeaderSplitBenchmark.cs (4)
32throw new Exception(); 42throw new Exception(); 52throw new Exception(); 62throw new Exception();
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UseExtensionsTests.cs (1)
67throw new Exception("From Use");
Microsoft.AspNetCore.Http.Connections.Tests (5)
HttpConnectionDispatcherTests.cs (1)
692throw new Exception("Too many callers.");
HttpConnectionManagerTests.cs (3)
86connection.ApplicationTask = Task.FromException(new Exception("Application failed")); 95throw new Exception("Transport failed"); 105connection.TransportTask = Task.FromException<bool>(new Exception("Application failed"));
WebSocketsTests.cs (1)
259connection.Transport.Output.Complete(new Exception());
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsOfTHelperTests.cs (1)
119throw new Exception("Shouldn't reach here.");
Microsoft.AspNetCore.Http.Tests (1)
Features\FormFeatureTests.cs (1)
666throw new Exception($"Value mismatch at loop {loops}, index {i}; A:{bytesA[i]}, B:{bytesB[i]}");
Microsoft.AspNetCore.Identity.Test (5)
SecurityStampValidatorTest.cs (3)
250signInManager.Setup(s => s.ValidateSecurityStampAsync(It.IsAny<ClaimsPrincipal>())).Throws(new Exception("Shouldn't be called")); 251signInManager.Setup(s => s.SignInAsync(user, false, null)).Throws(new Exception("Shouldn't be called")); 289signInManager.Setup(s => s.SignInAsync(user, false, null)).Throws(new Exception("Shouldn't be called"));
SignInManagerTest.cs (1)
405manager.Setup(m => m.AccessFailedAsync(user)).Throws(new Exception("Should not get called"));
UserManagerTest.cs (1)
1008throw new Exception();
Microsoft.AspNetCore.InternalTesting (1)
TestPathUtilities.cs (1)
43throw new Exception($"Solution file {solution}.slnf could not be found in {applicationBasePath} or its parent directories.");
Microsoft.AspNetCore.InternalTesting.Tests (6)
QuarantinedTestAttributeTest.cs (1)
18throw new Exception("Flaky!");
RetryTest.cs (2)
25throw new Exception($"NOOOOOOOO [retry count={_retryFailsUntil3}]"); 42throw new Exception($"NOOOOOOOO [retry count={_canOverrideRetries}]");
SkipOnCITests.cs (1)
18throw new Exception("Flaky!");
TestTestOutputHelper.cs (2)
23throw new Exception("Boom!"); 32throw new Exception("Boom!");
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
MiddlewareAnalysisTests.cs (1)
32throw new Exception("Test exception");
Microsoft.AspNetCore.Mvc.Abstractions.Test (12)
ModelBinding\ModelStateDictionaryTest.cs (12)
325var exception = new Exception(); 649var ex = new Exception(); 761dictionary.AddModelError("key2", new Exception(), metadata); 762dictionary.AddModelError("key3", new Exception(), metadata); 791result = dictionary.TryAddModelException("key2", new Exception()); 794result = dictionary.TryAddModelException("key3", new Exception()); 824result = dictionary.TryAddModelError("key2", new Exception(), metadata); 861dictionary.AddModelError("key1", new Exception(), metadata); 864dictionary.AddModelError("key3", new Exception(), metadata); 896result = dictionary.TryAddModelError("key2", new Exception(), metadata); 899result = dictionary.TryAddModelError("key3", new Exception(), metadata); 922dictionary.TryAddModelError("key3", new Exception(), metadata);
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\UnsupportedContentTypeFilterTest.cs (1)
116new Exception("error"),
ValidationProblemDetailsTest.cs (1)
58new Exception("This message should not be returned to clients"),
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\IHtmlDocumentExtensions.cs (1)
39throw new Exception($"Antiforgery token could not be located in {htmlDocument.Source.Text}.");
TempDataInCookiesTest.cs (1)
50throw new Exception($"Expected exactly one instance of TempDataSerializer based on NewtonsoftJson, but found {tempDataSerializers.Count} instance(s):" + Environment.NewLine + builder);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (4)
RuntimeViewCompilerTest.cs (4)
99viewCompiler.Compile = _ => throw new Exception("Can't call me"); 126viewCompiler.Compile = _ => throw new Exception("Can't call me"); 625throw new Exception(); 707compiler.Compile = _ => throw new Exception("Shouldn't be called");
Microsoft.AspNetCore.Mvc.Razor.Test (2)
RazorViewEngineTest.cs (2)
850.Throws(new Exception("Shouldn't be called")); 887.Throws(new Exception("Shouldn't be called"));
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
Filters\PageHandlerResultFilterTest.cs (1)
112.Throws(new Exception("Shouldn't be called"));
Infrastructure\PageHandlerPageFilterTest.cs (1)
114.Throws(new Exception("Shouldn't be called"));
PageModelTest.cs (1)
1901.Throws(new Exception("Shouldn't be called"));
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
CacheTagHelperTest.cs (3)
645throw new Exception(); 721throw new Exception(); 1050throw new Exception();
DistributedCacheTagHelperTest.cs (1)
653throw new Exception();
InputTagHelperTest.cs (2)
729throw new Exception("getChildContentAsync should not be called."); 800throw new Exception("getChildContentAsync should not be called.");
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (10)
CookieTempDataProviderTest.cs (1)
74.Throws(new Exception());
ModelStateDictionaryExtensionsTest.cs (8)
82var exception = new Exception(); 100var exception = new Exception(); 120var exception = new Exception(); 138var exception = new Exception(); 158var exception = new Exception(); 176var exception = new Exception(); 197var exception = new Exception(); 216var exception = new Exception();
ViewExecutorTest.cs (1)
304throw new Exception();
Microsoft.AspNetCore.Razor.Runtime.Test (2)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (2)
23executeChildContentAsync: () => throw new Exception(), 46executeChildContentAsync: () => throw new Exception(),
Microsoft.AspNetCore.Routing.Tests (6)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
187throw new Exception("Shouldn't reach here.");
CompositeEndpointDataSourceTest.cs (1)
64var ex = new Exception();
EndpointRoutingMiddlewareTest.cs (3)
171throw new Exception(); 193throw new Exception(); 221throw new Exception();
Tree\TreeRouterTest.cs (1)
1830throw new Exception();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (16)
Http2Tests.cs (3)
520throw new Exception("Application exception"); 554throw new Exception("Application exception"); 586throw new Exception("Application exception");
Http3Tests.cs (1)
223throw new Exception("App Exception");
Listener\Utilities.cs (1)
69throw new Exception("Failed to locate a free port.");
RequestTests.cs (2)
516result.SetException(new Exception("The CT isn't valid.")); 565result.SetException(new Exception("This should have aborted"));
ResponseCachingTests.cs (2)
455throw new Exception($"Failed to get first response for {status}", ex); 463throw new Exception($"Failed to get second response for {status}", ex);
ResponseTests.cs (1)
168throw new Exception("Failed OnStarting");
src\Shared\Http2cat\Http2Utilities.cs (5)
1009throw new Exception($"Assert.True failed: '{message}'"); 1017throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1025throw new Exception($"Assert.Equal('{expected}', '{actual}') failed"); 1033throw new Exception($"Assert.NotEqual('{value1}', '{value2}') failed"); 1041throw new Exception($"Assert.Contains(collection, '{value}') failed");
Utilities.cs (1)
169throw new Exception("Failed to locate a free port.");
Microsoft.AspNetCore.Server.IntegrationTesting (7)
ApplicationPublisher.cs (3)
27throw new Exception($"A target framework must be specified in the deployment parameters for applications that require publishing before deployment"); 86throw new Exception(message); 93throw new Exception(message);
Deployers\ApplicationDeployer.cs (1)
108throw new Exception($"Unable to find '{executableName}'.'");
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
263throw new Exception($"Failed to execute the script on '{_deploymentParameters.ServerName}'.");
Deployers\SelfHostDeployer.cs (2)
170started.TrySetException(new Exception($"Command exited unexpectedly with exit code: {HostProcess.ExitCode}")); 187throw new Exception("Failed to start host");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (5)
IISExpressDeployer.cs (5)
226started.TrySetException(new Exception($"Command exited unexpectedly with exit code: {process.ExitCode}")); 236throw new Exception("Failed to start host"); 363throw new Exception($"Unable to find '{executableName}'.'"); 388throw new Exception("Unable to find IISExpress on the machine: " + iisExpressPath); 442throw new Exception($"iisexpress Process {_hostProcess.Id} failed to shutdown");
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (20)
BodyControlTests.cs (4)
24var ex = new Exception("My error"); 41var ex = new Exception("My error"); 65var ex = new Exception("My error"); 90var ex = new Exception("My error");
ConcurrentPipeWriterTests.cs (5)
66var completeEx = new Exception(); 158var completeEx = new Exception(); 249var completeEx = new Exception(); 306var completeEx = new Exception(); 400var completeEx = new Exception();
HeartbeatTests.cs (1)
188var ex = new Exception();
Http1\Http1HttpProtocolFeatureCollectionTests.cs (1)
211throw new Exception($"Error for feature {type}.", ex);
HttpRequestPipeReaderTests.cs (1)
39var error = new Exception();
HttpRequestStreamTests.cs (2)
148var error = new Exception(); 182var error = new Exception();
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
84throw new Exception($"Couldn't find a free port after {startingPort}.");
src\Servers\Kestrel\shared\test\StreamExtensions.cs (1)
67throw new Exception("Stream read 0.");
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (1)
319throw new Exception($"Error when decoding with chunk size {i}.", ex);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (5)
Http2\Http2ConnectionBenchmarkBase.cs (1)
127throw new Exception($"Unexpected stream ID: {_receiveHttpFrame.StreamId}");
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
578throw new Exception("Reader didn't complete with frame");
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
QuicConnectionListenerTests.cs (2)
242throw new Exception("An error!"); 422throw new Exception("Connection not removed from CWT.");
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
84throw new Exception($"Couldn't find a free port after {startingPort}.");
src\Servers\Kestrel\shared\test\StreamExtensions.cs (1)
67throw new Exception("Stream read 0.");
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
Microsoft.AspNetCore.Shared.Tests (10)
runtime\Http3\QPackDecoderTest.cs (1)
319throw new Exception($"Error when decoding with chunk size {i}.", ex);
StackTraceHelperTest.cs (9)
273throw new Exception(); 277void MethodWithOutParameter(out int value) => throw new Exception(); 280void MethodWithGenericOutParameter<TVal>(string a, out TVal value) => throw new Exception(); 283void MethodWithRefParameter(ref int value) => throw new Exception(); 286void MethodWithGenericRefParameter<TVal>(ref TVal value) => throw new Exception(); 289void MethodWithNullableParameter(int? value) => throw new Exception(); 311public void Throw(T parameter) => throw new Exception(); 315private void GenericMethod<T>(T val) where T : class => throw new Exception(); 345private static void ThrowCore() => throw new Exception();
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
HubConnectionTests.cs (2)
1352var x => throw new Exception($"The test does not have an exception string for the protocol '{x}'!"), 1406var x => throw new Exception($"The test does not have an exception string for the protocol '{x}'!"),
Microsoft.AspNetCore.SignalR.Client.Tests (23)
HttpConnectionFactoryTests.cs (1)
29testHandler.OnRequest((req, next, ct) => Task.FromException<HttpResponseMessage>(new Exception("BOOM")));
HttpConnectionTests.ConnectionLifecycle.cs (2)
91var expected = new Exception("Transport failed to start"); 143var expected = new Exception("Transport failed to start");
HubConnectionTests.cs (1)
592channel.Writer.Complete(new Exception("error from client"));
HubConnectionTests.Protocol.cs (2)
761throw new Exception("error from client"); 788throw new Exception("error from client");
HubConnectionTests.Reconnect.cs (17)
40var exception = new Exception(); 155var firstException = new Exception(); 164var reconnectException = new Exception(); 252var firstException = new Exception(); 261var reconnectException = new Exception(); 347var firstException = new Exception(); 352var reconnectException = new Exception(); 429var firstException = new Exception(); 447var secondException = new Exception(); 661var firstException = new Exception(); 716var firstException = new Exception(); 796var firstException = new Exception(); 805var secondException = new Exception(); 903var firstException = new Exception(); 1023var firstException = new Exception(); 1032var secondException = new Exception(); 1100var firstException = new Exception();
Microsoft.AspNetCore.SignalR.Microbenchmarks (12)
DefaultHubDispatcherBenchmark.cs (1)
100throw new Exception("Error invoking hub method: " + completionMessage.Error);
HandshakeProtocolBenchmark.cs (11)
94throw new Exception(); 104throw new Exception(); 114throw new Exception(); 124throw new Exception(); 134throw new Exception(); 144throw new Exception(); 154throw new Exception(); 164throw new Exception(); 174throw new Exception(); 184throw new Exception(); 194throw new Exception();
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\testassets\Tests.Utils\HubConnectionContextUtils.cs (1)
51throw new Exception();
src\SignalR\common\testassets\Tests.Utils\TaskExtensions.cs (1)
19throw new Exception("Unreachable code");
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Docker.cs (2)
106throw new Exception("Redis took too long to start."); 166throw new Exception($"Command '{fileName} {arguments}' failed with exit code '{exitCode}'. Output:{Environment.NewLine}{output}");
Microsoft.AspNetCore.SignalR.Tests (6)
EndToEndTests.cs (1)
740return Task.FromException(new Exception());
HubConnectionHandlerTests.ClientResult.cs (1)
355throw new Exception($"Protocol {protocol} not handled by test.");
HubConnectionHandlerTestUtils\Hubs.cs (4)
749throw new Exception("Exception from async enumerable"); 779channel.Writer.TryComplete(new Exception("Exception from channel")); 793channel.Writer.TryComplete(new ChannelClosedException(new Exception("ChannelClosedException from channel"))); 799throw new Exception("Throw from hub method");
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
HubConnectionContextUtils.cs (1)
51throw new Exception();
TaskExtensions.cs (1)
19throw new Exception("Unreachable code");
Microsoft.AspNetCore.TestHost.Tests (1)
TestServerTests.cs (1)
758throw new Exception("Test exception");
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnTester.cs (1)
48throw new Exception("wstest failed");
Microsoft.Build (2)
BackEnd\BuildManager\BuildManager.cs (1)
3254throw new Exception(message);
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
906throw new Exception(taskException.Message, taskException);
Microsoft.Build.BuildCheck.UnitTests (3)
TestAssets\ErrorCustomCheck\ErrorOnInitializeCheck.cs (1)
27throw new Exception("Something went wrong initializing");
TestAssets\ErrorCustomCheck\ErrorOnRegisteredAction.cs (1)
36throw new Exception("something went wrong when executing registered action");
TestAssets\ErrorCustomCheck\ErrorWhenRegisteringActions.cs (1)
32throw new Exception("something went wrong when registering actions");
Microsoft.Build.CommandLine.UnitTests (1)
NodeStatus_Transition_Tests.cs (1)
162throw new Exception($$"""
Microsoft.Build.Engine.OM.UnitTests (2)
ObjectModelRemoting\RemoteProjectsProviderMock\ExporterMock.cs (2)
204throw new Exception("Can not connect to self"); 290throw new Exception("Not connected!");
Microsoft.Build.Engine.UnitTests (33)
BackEnd\BuildResult_Tests.cs (2)
101result.AddResultsForTarget("bar", new TargetResult(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Success, WorkUnitActionCode.Continue, new Exception()))); 104result.AddResultsForTarget("baz", new TargetResult(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult(new Exception())));
BackEnd\DebugUtils_tests.cs (1)
27ExceptionHandling.DumpExceptionToFile(new Exception("hello world"));
BackEnd\EventSourceSink_Tests.cs (7)
173throw new Exception(); 193Exception[] exceptionArray = new Exception[] { new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions 204Exception[] exceptionArray1 = new Exception[] { new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions 207Exception[] exceptionArray2 = new Exception[] { ae1, new Exception() }; //// two non-critical exceptions (ae1 contains nested exceptions) 228Exception[] exceptionArray = new Exception[] { new OutOfMemoryException(), new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions, one critical 239Exception[] exceptionArray1 = new Exception[] { new OutOfMemoryException(), new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions, one critical 242Exception[] exceptionArray2 = new Exception[] { ae1, new Exception() }; //// one critical one non-critical (ae1 contains nested critical exception)
BackEnd\LoggingService_Tests.cs (3)
173logger = new LoggerThrowException(true, false, new Exception("boo")); 245LoggerThrowException exceptionLogger = new LoggerThrowException(false, true, new Exception()); 1246: base(true, false, new Exception("Hello"))
BackEnd\LoggingServicesLogMethod_Tests.cs (9)
217service.LogFatalError(null, new Exception("SuperException"), new BuildEventFileInfo("foo.cs"), "FatalTaskError", "TaskName"); 230service.LogFatalError(s_buildEventContext, new Exception("SuperException"), null, "FatalTaskError", "TaskName"); 262service.LogFatalError(s_buildEventContext, new Exception("SuperException"), fileInfo, null); 276service.LogFatalError(s_buildEventContext, new Exception("SuperException"), fileInfo, string.Empty, null); 287Exception exception = new Exception("SuperException"); 311Exception exception = new Exception("SuperException"); 336service.LogFatalTaskError(s_buildEventContext, new Exception("SuperException"), fileInfo, null); 347Exception exception = new Exception("SuperException"); 553Exception exception = new Exception("SuperException");
BackEnd\ResultsCache_Tests.cs (1)
130BuildResult result2 = new BuildResult(request, new Exception("Test exception"));
BackEnd\SdkResolverLoader_Tests.cs (2)
193LoadResolverAssemblyFunc = (resolverPath) => throw new Exception(expectedMessage), 405throw new Exception(ExpectedMessage);
BackEnd\TaskThatThrows.cs (1)
29Exception exceptionInstance = (Exception)(ctor?.Invoke([exceptionMessage]) ?? new Exception(exceptionMessage));
Construction\SolutionFile_OldParser_Tests.cs (1)
928throw new Exception("Failed to parse solution containing description information. Error: " + ex.Message, ex);
Graph\ParallelWorkSet_Tests.cs (6)
47WorkFunc = () => throw new Exception() 52WorkFunc = () => throw new Exception() 57WorkFunc = () => throw new Exception() 75WorkFunc = () => throw new Exception() 80WorkFunc = () => throw new Exception() 85WorkFunc = () => throw new Exception()
Microsoft.Build.Tasks.CodeAnalysis (2)
ManagedCompiler.cs (1)
802_ => throw new Exception($"Unexpected value {kind}"),
src\Compilers\Shared\BuildServerConnection.cs (1)
270throw new Exception(message, e);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (5)
CscTests.cs (1)
551LogFunc = delegate { throw new Exception(""); }
TestUtilities\ErrorLoggerEngine.cs (3)
27var formattingClass = assembly.GetType("Microsoft.Build.Shared.EventArgsFormatting") ?? throw new Exception("Could not find EventArgsFormatting type"); 29new Type[] { typeof(BuildErrorEventArgs) }, null) ?? throw new Exception("Could not find FormatEventMessage(BuildErrorEventArgs)."); 31new Type[] { typeof(BuildWarningEventArgs) }, null) ?? throw new Exception("Could not find FormatEventMessage(BuildWarningEventArgs).");
VbcTests.cs (1)
518LogFunc = delegate { throw new Exception(""); }
Microsoft.Build.Tasks.Core (1)
RedistList.cs (1)
583allowListErrors.Add(new Exception(ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ResolveAssemblyReference.NoSubSetRedistListName", info.Path)));
Microsoft.Build.Tasks.UnitTests (7)
StreamMappedString_Tests.cs (7)
285get { throw new Exception("The method or operation is not implemented."); } 290get { throw new Exception("The method or operation is not implemented."); } 295throw new Exception("The method or operation is not implemented."); 300get { throw new Exception("The method or operation is not implemented."); } 311throw new Exception("The method or operation is not implemented."); 328throw new Exception("The method or operation is not implemented."); 333throw new Exception("The method or operation is not implemented.");
Microsoft.Build.Utilities.UnitTests (1)
TaskLoggingHelper_Tests.cs (1)
251throw new Exception(message, inner);
Microsoft.CodeAnalysis.CSharp (1)
Parser\LanguageParser.cs (1)
13816get { throw new Exception("Use IsIncrementalAndFactoryContextMatches"); }
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
14772public void Execute(GeneratorExecutionContext context) => throw new System.Exception("THROW"); 14816public void Initialize(GeneratorInitializationContext context) => throw new System.Exception("THROW");
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
CodeActions\Preview\ErrorCases\ExceptionInCodeAction.cs (9)
30throw new Exception($"Exception thrown from get_Title in {nameof(ExceptionCodeAction)}"); 38throw new Exception($"Exception thrown from get_EquivalenceKey in {nameof(ExceptionCodeAction)}"); 43=> throw new Exception($"Exception thrown from ComputePreviewOperationsAsync in {nameof(ExceptionCodeAction)}"); 46=> throw new Exception($"Exception thrown from ComputeOperationsAsync in {nameof(ExceptionCodeAction)}"); 49=> throw new Exception($"Exception thrown from GetChangedDocumentAsync in {nameof(ExceptionCodeAction)}"); 52=> throw new Exception($"Exception thrown from GetChangedSolutionAsync in {nameof(ExceptionCodeAction)}"); 55=> throw new Exception($"Exception thrown from PostProcessChangesAsync in {nameof(ExceptionCodeAction)}"); 58=> throw new Exception($"Exception thrown from GetHashCode in {nameof(ExceptionCodeAction)}"); 61=> throw new Exception($"Exception thrown from Equals in {nameof(ExceptionCodeAction)}");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\ResourceTests.cs (1)
213new ResourceDescription("r2", "file", () => { throw new Exception("bad stuff"); }, false)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\PDBSourceLinkTests.cs (1)
119var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); });
PDB\PortablePdbTests.cs (1)
379var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); });
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Attributes\EmitTestStrongNameProvider.cs (2)
24var ex = new Exception("Crazy exception you could never have predicted!"); 46var ex = new Exception("Crazy exception you could never have predicted!");
Diagnostics\GetDiagnosticsTests.cs (3)
974throw new Exception($"Unexpected topmost node for code block '{context.CodeBlock.Kind()}'"); 993throw new Exception($"Unexpected topmost node for operation block '{operationBlock.Syntax.Kind()}'"); 1007throw new Exception($"Multiple callbacks for {context.Node}");
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (6)
EndToEndTests.cs (6)
131_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 191_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}, Desktop: {RuntimeUtilities.IsDesktopRuntime}") 221throw new Exception($"Depth: {i}, Bytes: {IntPtr.Size}, Config: {ExecutionConditionUtil.Configuration}, Desktop: {RuntimeUtilities.IsDesktopRuntime}", e); 270_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 421_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 556_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}")
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (13)
ObjectFormatterTests.cs (13)
507throw new Exception("xxx"); 903throw new Exception(); 909throw new Exception(); 918throw new Exception(); 924throw new Exception(); 942$@"{new Exception().Message} 966$@"{new Exception().Message} 990$@"{new Exception().Message} 1014$@"{new Exception().Message} 1061throw new Exception(); 1067throw new Exception(); 1087$@"{new Exception().Message} 1112$@"{new Exception().Message}
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\UnsafeTests.cs (1)
38throw new Exception("Unrecognized new line");
SourceGeneration\SyntaxAwareGeneratorTests.cs (9)
375var exception = new Exception("Test Exception"); 417var exception = new Exception("Test Exception"); 459TestSyntaxReceiver receiver1 = new TestSyntaxReceiver(tag: 0, callback: (a) => { if (a is PropertyDeclarationSyntax) throw new Exception("Test Exception"); }); 501var exception = new Exception("Test Exception"); 556var exception = new Exception("test exception"); 624var exception = new Exception("test exception"); 1855var exception = new Exception("Test Exception"); 1896var exception = new Exception("Test Exception"); 1937var exception = new Exception("Test Exception");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DeclarationTests.cs (1)
927throw new Exception("Should have found the node");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
IncrementalParsing\BinaryExpression.cs (1)
276throw new Exception("unexpected Type given");
IncrementalParsing\ChangingIdentifiers.cs (1)
237throw new Exception("Unexpected type here!!");
IncrementalParsing\CompoundAssignment.cs (1)
140throw new Exception("No operator found");
IncrementalParsing\UnaryExpression.cs (1)
128throw new Exception("Unexpected case");
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestSource.cs (1)
74throw new Exception($"Unexpected value: {Value}");
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
112throw new Exception($"use {nameof(TestNoImportsAddedAsync)}");
Microsoft.CodeAnalysis.EditorFeatures (1)
Shared\Utilities\ClassificationTypeMap.cs (1)
59FatalError.ReportAndCatch(new Exception($"classification type doesn't exist for {name}"));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\CodeFixServiceTests.cs (1)
343() => throwExceptionInFixerCreation ? throw new Exception() : codefix,
CodeFixes\ErrorCases\CodeFixExceptionInFixableDiagnosticIds.cs (1)
20throw new Exception($"Exception thrown in FixableDiagnosticIds of {nameof(ExceptionInFixableDiagnosticIds)}");
CodeFixes\ErrorCases\CodeFixExceptionInGetFixAllProvider.cs (1)
23=> throw new Exception($"Exception thrown in GetFixAllProvider of {nameof(ExceptionInGetFixAllProvider)}");
CodeFixes\ErrorCases\CodeFixExceptionInRegisterMethod.cs (1)
22=> throw new Exception($"Exception thrown in register method of {nameof(ExceptionInRegisterMethod)}");
CodeFixes\ErrorCases\CodeFixExceptionInRegisterMethodAsync.cs (1)
24throw new Exception($"Exception thrown in register method of {nameof(ExceptionInRegisterMethodAsync)}");
CodeRefactorings\ErrorCases\CodeRefactoringExceptionInComputeRefactorings.cs (1)
27=> throw new Exception($"Exception thrown from ComputeRefactoringsAsync in {nameof(ExceptionInCodeActions)}");
CodeRefactorings\ErrorCases\CodeRefactoringExceptionInComputeRefactoringsAsync.cs (1)
29throw new Exception($"Exception thrown from ComputeRefactoringsAsync in {nameof(ExceptionInCodeActions)}");
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (2)
116[new ThrowExceptionForEachNamedTypeAnalyzer(ExceptionDispatchInfo.Capture(new Exception()))], 126[new ThrowExceptionFromSupportedDiagnostics(new Exception())],
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Peek\DefinitionPeekableItem.cs (1)
64callback.ReportFailure(new Exception(EditorFeaturesResources.No_information_found));
Preview\DifferenceViewerPreview.cs (1)
90FatalError.ReportAndCatch(new Exception($"Dispose is not called how? viewer state : {_viewer?.IsClosed}"));
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Editor\Shared\Utilities\FSharpClassificationTypeMap.cs (1)
49FatalError.ReportAndCatch(new Exception($"classification type doesn't exist for {name}"));
Microsoft.CodeAnalysis.Features (2)
ExtractMethod\ExtractMethodMatrix.cs (1)
98FatalError.ReportAndCatch(new Exception($"extract method encountered unknown states: {key.ToString()}"), ErrorSeverity.Critical);
LanguageServiceIndexFormat\SymbolMoniker.cs (1)
78throw new Exception($"Unable to get documentation comment ID for {symbol.ToDisplayString()}");
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
418throw new Exception($"Unable to find node with span {span} `{root.GetText().GetSubText(span)}` in:{Environment.NewLine}{root}");
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
357FatalError.ReportAndCatch(new Exception("Bug in GetDiagnostics"));
Handler\RequestContext.cs (1)
281FatalError.ReportWithDumpAndCatch(new Exception(
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\QueueItem.cs (1)
256var exception = new Exception(message);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Completion\CompletionFeaturesTests.cs (1)
899throw new Exception("GetChangeAsync throws");
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (1)
306throw new Exception($"Please return a non-default value based on the config name, config name: {option.Name}.");
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
TelemetryReporterTests.cs (1)
52service.ReportFault(GetEventName(nameof(TestFault)), "test description", logLevel: 2, forceDump: false, processId: 0, new Exception());
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (1)
55throw new Exception($"LSP process exited immediately with {process.ExitCode}");
Microsoft.CodeAnalysis.Rebuild (2)
CompilationOptionsReader.cs (1)
103throw new Exception(RebuildResources.Invalid_language_name);
VisualBasicCompilationFactory.cs (1)
81throw new Exception(string.Format(RebuildResources.Cannot_create_compilation_options_0, diagnostic));
Microsoft.CodeAnalysis.Scripting.TestUtilities (4)
ObjectFormatterFixtures\Custom.cs (4)
269public int _34_Exception { get { throw new Exception("error1"); } } 272public int _35_Exception { get { throw new Exception("error2"); } } 277public int _37 { get { throw new Exception("error3"); } } 464throw new Exception();
Microsoft.CodeAnalysis.Test.Utilities (16)
CompilationVerifier.cs (6)
119throw new Exception($"Didn't find method '{methodName}'. Available/distinguishable methods are: {Environment.NewLine}{string.Join(Environment.NewLine, map.Keys)}"); 329throw new Exception($"ILVerify was not able to resolve a module named '{simpleName}'"); 351throw new Exception($"Multiple modules named '{name}' were found"); 366throw new Exception("No corlib found"); 377throw new Exception(expectedSuccess ? 633throw new Exception($"Failed to extract PDB information. PdbToXmlConverter returned:{Environment.NewLine}{actualPdbXml}");
Diagnostics\CommonDiagnosticAnalyzers.cs (3)
1770throw new Exception("Expected driver to make a single callback per tree"); 1785throw new Exception("Expected driver to make a single callback per text"); 1835throw new Exception("Expected driver to make a callback for every tree");
FX\CappedStringWriter.cs (1)
39throw new Exception($"Test produced more output than expected ({_expectedLength} characters). Is it in an infinite loop? Output so far:\r\n{GetStringBuilder()}");
Platform\CoreClr\TestExecutionLoadContext.cs (2)
85throw new Exception("Unrecognized entry point"); 113throw new Exception($"Error getting signatures {fullyQualifiedTypeName}.{memberName}", ex);
TargetFrameworkUtil.cs (3)
354throw new Exception($"Duplicate reference detected {r.Display}"); 360throw new Exception($"Duplicate reference detected {r.Display} - {name}"); 439throw new Exception(message, ex);
TestableCompiler.cs (1)
185throw new Exception("invalid value");
Microsoft.CodeAnalysis.UnitTests (8)
Analyzers\AnalyzerFileReferenceTests.cs (2)
751public Assembly LoadFromPath(string fullPath) => throw new Exception(); 752public string? GetOriginalDependencyLocation(AssemblyName assembly) => throw new Exception();
Collections\List\SegmentedList.Generic.Tests.IndexOf.cs (1)
54throw new Exception("Invalid IndexOfMethod");
Diagnostics\AnalysisContextInfoTests.cs (1)
93throw new Exception("exception");
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
99var exception = new Exception(); 158var exception = new Exception();
RealParserTests.cs (2)
410throw new Exception($@" 583throw new Exception($@"Error for float input ""{s}""
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\DocumentState.cs (1)
688FatalError.ReportAndCatch(new Exception($"tree and text has different length {newTree.Length} vs {newText.Length}"), ErrorSeverity.Critical);
Workspace\Solution\SolutionState.cs (1)
1325FatalError.ReportAndCatch(new Exception("GetDocumentIdsWithFilePath returned a document in a project that does not exist."));
Microsoft.CodeAnalysis.Workspaces.MSBuild (8)
MSBuild\BuildHostProcessManager.cs (3)
100throw new Exception($"BuildHost process exited immediately with {process.ExitCode}"); 233throw new Exception(string.Format(WorkspaceMSBuildResources.The_build_host_could_not_be_found_at_0, buildHostPath)); 389throw new Exception("Ownership of BuildHost pipe is incorrect.");
MSBuild\MSBuildProjectLoader.cs (1)
180throw new Exception(string.Format(WorkspaceMSBuildResources.Failed_to_load_solution_filter_0, solutionFilePath));
MSBuild\MSBuildProjectLoader.Worker.cs (2)
324throw new Exception(message); 413throw new Exception(message);
Rpc\RpcClient.cs (2)
92completionSource.SetException(new Exception("Unable to deserialize the result", ex)); 105request.SetException(processingException ?? new System.Exception("The server disconnected unexpectedly."));
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Rpc\RpcServer.cs (1)
75throw new Exception($"Failure while deserializing '{line}'", innerException: e);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
MSBuildWorkspaceTestBase.cs (1)
154workspace.WorkspaceFailed += (s, e) => throw new Exception($"Workspace failure {e.Diagnostic.Kind}:{e.Diagnostic.Message}");
RpcTests.cs (1)
262private sealed class ObjectWithThrowingMethod { public void ThrowException() { throw new Exception("Exception thrown by test method!"); } }
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (1)
75throw new Exception($"Failure while deserializing '{line}'", innerException: e);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace_XmlConsumption.cs (2)
325throw new Exception($"LanguageVersion attribute on {languageVersionAttribute.Parent} was not recognized."); 961throw new Exception($"Element {element} has child text that isn't recognized. The XML syntax is invalid.");
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
SolutionTests\TryApplyChangesTests.cs (2)
75canApplyCompilationOptions: (_, __) => throw new Exception("This should not have been called.")); 118canApplyParseOptions: (_, __) => throw new Exception("This should not have been called."));
UtilityTest\AsyncLazyTests.cs (2)
44asynchronousComputeFunction: static (arg, c) => { throw new Exception("We should not get an asynchronous computation."); }, 58throw new Exception("Task blew up!");
UtilityTest\CancellationSeriesTests.cs (1)
121var exception = new Exception();
UtilityTest\ExceptionHelpersTests.cs (1)
65var e = new Exception("Hello");
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
QueueItem.cs (1)
256var exception = new Exception(message);
Microsoft.Data.Analysis (13)
TextFieldParser.cs (13)
668throw new Exception(Strings.ExceededMaxBufferSize); 804throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 822throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 828throw new Exception(string.Format(Strings.LineExceedsMaxLineSize, currentLineNumber)); 837throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 939throw new Exception(string.Format(Strings.CannotParseWithFieldWidths, lineNumber)); 987throw new Exception(Strings.NullDelimiters); 991throw new Exception(Strings.EmptyDelimiters); 1003throw new Exception(Strings.IllegalQuoteDelimiter); 1046throw new Exception(Strings.IllegalQuoteDelimiter); 1063throw new Exception(Strings.EmptyDelimiters); 1067throw new Exception(Strings.DelimiterCannotBeNewlineChar); 1135throw new Exception(Strings.CommentTokenCannotContainWhitespace);
Microsoft.Data.Analysis.Tests (13)
src\Microsoft.Data.Analysis\TextFieldParser.cs (13)
668throw new Exception(Strings.ExceededMaxBufferSize); 804throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 822throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 828throw new Exception(string.Format(Strings.LineExceedsMaxLineSize, currentLineNumber)); 837throw new Exception(string.Format(Strings.CannotParseWithDelimiters, currentLineNumber)); 939throw new Exception(string.Format(Strings.CannotParseWithFieldWidths, lineNumber)); 987throw new Exception(Strings.NullDelimiters); 991throw new Exception(Strings.EmptyDelimiters); 1003throw new Exception(Strings.IllegalQuoteDelimiter); 1046throw new Exception(Strings.IllegalQuoteDelimiter); 1063throw new Exception(Strings.EmptyDelimiters); 1067throw new Exception(Strings.DelimiterCannotBeNewlineChar); 1135throw new Exception(Strings.CommentTokenCannotContainWhitespace);
Microsoft.DotNet.Build.Tasks.Feed (9)
src\BlobFeedAction.cs (1)
55throw new Exception("Unable to parse expected feed. Please check ExpectedFeedUrl.");
src\common\AzureStorageUtils.cs (1)
135throw new Exception($"Failed to upload local file '{filePath}' to '{blobPath} in {retryHandler.MaxAttempts} attempts. See inner exception for details.", mostRecentlyCaughtException);
src\common\UploadToAzure.cs (3)
94throw new Exception(string.Format("Metadata 'RelativeBlobPath' is missing for item '{0}'.", item.ItemSpec)); 99throw new Exception(string.Format("The file '{0}' does not exist.", item.ItemSpec)); 114throw new Exception(string.Format("The blob '{0}' already exists.", relativeBlobPath));
src\CreateAzureDevOpsFeed.cs (1)
174throw new Exception($"Feed '{baseFeedName}' was not created. Request failed with status code {createFeedResponse.StatusCode}. Exception: {await createFeedResponse.Content.ReadAsStringAsync()}");
src\model\SetupTargetFeedConfigV3.cs (2)
211throw new Exception($"Problems creating an AzureDevOps (symbols) feed for repository '{RepositoryName}' and commit '{CommitSha}'."); 238throw new Exception($"Problems creating an AzureDevOps feed for repository '{RepositoryName}' and commit '{CommitSha}'.");
src\PushToBuildStorage.cs (1)
122throw new Exception($"AssetsLocalStorageDir, ShippingPackagesLocalStorageDir, NonShippingPackagesLocalStorageDir and AssetManifestsLocalStorageDir need to be specified if PublishToLocalStorage is set to true");
Microsoft.DotNet.Build.Tasks.Workloads (17)
Msi\MsiBase.wix.cs (1)
227throw new Exception(Strings.FailedToLinkMsi);
Msi\WorkloadManifestMsi.wix.cs (3)
63throw new Exception(Strings.HeatFailedToHarvest); 98throw new Exception(Strings.HeatFailedToHarvest); 154throw new Exception(Strings.FailedToCompileMsi);
Msi\WorkloadPackGroupMsi.wix.cs (2)
74throw new Exception(Strings.HeatFailedToHarvest); 140throw new Exception(Strings.FailedToCompileMsi);
Msi\WorkloadPackMsi.wix.cs (2)
45throw new Exception(Strings.HeatFailedToHarvest); 74throw new Exception(Strings.FailedToCompileMsi);
Msi\WorkloadSetMsi.wix.cs (2)
45throw new Exception(Strings.HeatFailedToHarvest); 71throw new Exception(Strings.FailedToCompileMsi);
Swix\SwixComponent.cs (3)
171resourceItem != null && !string.IsNullOrEmpty(resourceItem.GetMetadata(Metadata.Title)) ? resourceItem.GetMetadata(Metadata.Title) : workload.Description ?? throw new Exception(Strings.ComponentTitleCannotBeNull), 172resourceItem != null && !string.IsNullOrEmpty(resourceItem.GetMetadata(Metadata.Description)) ? resourceItem.GetMetadata(Metadata.Description) : workload.Description ?? throw new Exception(Strings.ComponentDescriptionCannotBeNull), 174resourceItem != null && !string.IsNullOrEmpty(resourceItem.GetMetadata(Metadata.Category)) ? resourceItem.GetMetadata(Metadata.Category) : DefaultValues.ComponentCategory ?? throw new Exception(Strings.ComponentCategoryCannotBeNull),
Swix\SwixProjectBase.cs (1)
110throw new Exception(string.Format(Strings.RelativePackagePathTooLong, MaxRelativePackagePath, relativePackagePath));
WorkloadPackageBase.cs (1)
337throw new Exception(string.Format(Strings.NoInstallerVersion, taskName,
WorkloadSetPackage.wix.cs (2)
104throw new Exception(string.Format(Strings.InvalidWorkloadSetPackageMissingDataDir, Id)); 131throw new Exception(string.Format(Strings.InvalidWorkloadSetPackageNoWorkloadSet, Id));
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.GenFacades (1)
RoslynBuildTask.cs (1)
67throw new Exception($"The minimum version required of Roslyn is '{name.Version}' and you are using '{resolvedVersion}' version of the Roslyn. You can update the sdk to get the latest version.");
Microsoft.DotNet.Git.IssueManager (1)
Clients\AzureDevOpsClient.cs (1)
43throw new Exception($"No commit with id {commit} found in '{repositoryUrl}'");
Microsoft.DotNet.Helix.Sdk (3)
FindDotNetCliPackage.cs (2)
254throw new Exception($"Failed to GET from {SanitizeString(uri)}, even after retrying"); 278throw new Exception($"Failed to make HEAD request to {SanitizeString(uri)}, even after retrying");
ProvisioningProfileProvider.cs (1)
212throw new Exception("Failed to download provisioning profile. More details can be found with higher verbosity or in the binlog");
Microsoft.DotNet.MacOsPkg (17)
AppBundle.cs (2)
34throw new Exception("Unexpected .app directory structure. Please contact dnceng."); 64throw new Exception("No signature found in app bundle");
ExecuteHelper.cs (1)
30throw new Exception($"Command '{command} {arguments}' failed with exit code {process.ExitCode}: {process.StandardError.ReadToEnd()}");
Package.cs (5)
32throw new Exception("Cannot unpack: no 'Distribution' or 'PackageInfo' file found in package"); 51throw new Exception("Cannot pack: no 'Distribution' or 'PackageInfo' file found in package"); 196?? throw new Exception("Payload was not found")); 202pkgInfo.Attribute(elementName)?.Value ?? throw new Exception($"{elementName} is required in PackageInfo"); 212throw new Exception("No signature found in package");
Program.cs (9)
80var srcPath = result.GetValue(pkgOrAppArgument) ?? throw new Exception("src must be non-empty"); 85throw new Exception("Input path must be a .pkg or .app (zipped) file."); 108var srcPath = result.GetValue(packSrcArgument) ?? throw new Exception("src must be non-empty"); 109var dstPath = result.GetValue(packDstArgument) ?? throw new Exception("dst must be non-empty"); 115throw new Exception("Input path must be a valid directory."); 120throw new Exception("Output path must be a .pkg or .app (zipped) file."); 146var srcPath = result.GetValue(unpackSrcArgument) ?? throw new Exception("src must be non-empty"); 147var dstPath = result.GetValue(unpackDestinationArgument) ?? throw new Exception("dst must be non-empty"); 153throw new Exception("Input path must be an existing .pkg or .app (zipped) file.");
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\AssertEx.cs (1)
393throw new Exception("No exception was thrown.");
Microsoft.DotNet.SignTool (6)
src\Configuration.cs (1)
559throw new Exception($"Unexpected signing status {signingStatus}");
src\VerifySignatures.cs (1)
252throw new Exception($"Command '{command}' failed with exit code {process.ExitCode}");
src\ZipData.cs (4)
308throw new Exception($"Pkg tooling is only supported on MacOS."); 337throw new Exception($"Failed to unpack pkg {archivePath}"); 594throw new Exception($"Failed to create MD5 checksums file for: {FileSignInfo.FileName}"); 746throw new Exception($"Failed to create RPM package: {FileSignInfo.FileName}");
Microsoft.DotNet.VersionTools (2)
Automation\DependencyUpdateResults.cs (1)
46throw new Exception(
BuildInfo.cs (1)
185throw new Exception($"More than one package list entry with id '{id}'.");
Microsoft.DotNet.VersionTools.Tasks (2)
BaseDependenciesTask.cs (1)
436throw new Exception($"Unable to create build info with '{item}'.");
UpdateToRemoteDependencies.cs (1)
108throw new Exception($"Could not find element '{elementName}' in '{path}'.");
Microsoft.DotNet.XliffTasks (1)
ExponentialRetry.cs (1)
33throw new Exception("Timer should not be exhausted");
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionCallContentTests..cs (1)
73Exception e = new();
Contents\FunctionResultContentTests.cs (1)
60Exception e = new();
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Infrastructure\RedisTestConfig.cs (4)
119throw new Exception("Could not find " + RedisServerExeName + 184throw new Exception("Could not start Redis Server at path " 192throw new Exception("Could not start Redis Server at path " 198throw new Exception("Got null process trying to start Redis Server at path "
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (4)
DefaultHealthCheckServiceTest.cs (4)
61var exception = new Exception("Things are pretty bad!"); 129b.AddAsyncCheck("ExceptionCheck", _ => throw new Exception(ExceptionMessage), exceptionTags); 167var exception = new Exception("Things are pretty bad!"); 712throw new Exception("check failed");
Microsoft.JSInterop.Tests (1)
JSRuntimeTest.cs (1)
302var exception = new Exception("Some really sensitive data in here");
Microsoft.Maui (6)
Layouts\Flex.cs (4)
527 throw new Exception("basis should >=0"); 529 throw new Exception("relative basis should be <=1"); 559 throw new Exception("shrink and grow should be >= 0"); 830 throw new Exception();
Layouts\FlexLayoutManager.cs (1)
34 throw new Exception("something is deeply wrong");
Platform\ElementExtensions.cs (1)
152 throw new Exception($"Handler not found for window {element}.");
Microsoft.Maui.Controls (14)
Internals\ProfilePage.cs (1)
40 throw new Exception("assert");
LegacyLayouts\FlexLayout.cs (1)
428 throw new Exception("something is deeply wrong");
LegacyLayouts\RelativeLayout.cs (2)
248 throw new Exception("BoundsConstraint should not be null at this point"); 333 throw new Exception("BoundsConstraint should not be null at this point");
ReferenceTypeConverter.cs (1)
43 throw new Exception("Can't resolve name on Element");
Shell\ShellSection.cs (4)
115 throw new Exception("Nav Stack consistency error"); 132 throw new Exception("Nav Stack consistency error"); 155 throw new Exception("Nav Stack consistency error"); 171 throw new Exception("Nav Stack consistency error");
Shell\ShellUriHandler.cs (2)
337 throw new Exception($"Global routes currently cannot be the only page on the stack, so absolute routing to global routes is not supported. For now, just navigate to: {replaced}"); 394 throw new Exception($"Relative routing to shell elements is currently not supported. Try prefixing your uri with ///: ///{originalRequest}");
StyleSheets\Style.cs (1)
53 throw new Exception();
StyleSheets\StyleSheet.cs (1)
82 throw new Exception();
StyleSheets\TextReaderExtensions.cs (1)
33 throw new Exception();
Microsoft.Maui.Controls.Build.Tasks (1)
CompiledConverters\ICompiledTypeConverter.cs (1)
24 throw new Exception();
Microsoft.Maui.Controls.SourceGen (3)
CodeBehindGenerator.cs (3)
146 return new XamlProjectItem(projectItem, new Exception($"{XamlParser.FormsUri} is not a valid namespace. Use {XamlParser.MauiUri} instead")); 301 throw new Exception("Something went wrong"); 476 var name = GetAttributeValue(node, "Name", XamlParser.X2006Uri, XamlParser.X2009Uri) ?? throw new Exception();
Microsoft.Maui.Controls.Xaml (1)
ExpandMarkupsVisitor.cs (1)
95 throw new Exception();
Microsoft.Maui.Graphics (2)
PathBuilder.cs (2)
55 throw new Exception("Error parsing a path value.", exc); 83 throw new Exception($"Error parsing {value} as a float.");
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (3)
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvasState.cs (2)
485 throw new Exception("Only one clip operation currently supported."); 514 throw new Exception("Only one subtraction currently supported.");
src\Graphics\src\Graphics\Platforms\Windows\PlatformImage.cs (1)
163 throw new Exception("No resource creator has been registered globally or for this thread.");
Microsoft.ML.AutoML (5)
AutoMlUtils.cs (1)
36throw new Exception("inputs and outputs count must match");
SweepableEstimator\Estimators\ForecastBySsa.cs (1)
15throw new Exception("ForecastBySsa param check error");
Tuner\AutoZeroTuner.cs (2)
45_ => throw new Exception(), 52_ => throw new Exception(),
Utils\Entity.cs (1)
57throw new Exception("Not Implemented");
Microsoft.ML.CodeGenerator (16)
CodeGenerator\CSharp\CSharpCodeFile.cs (1)
37throw new Exception("CSharp file extesion must be .cs");
CodeGenerator\CSharp\CSharpProjectFile.cs (1)
37throw new Exception("CSharp project file extesion must be .csproj");
CodeGenerator\CSharp\TransformGenerators.cs (14)
24string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 82string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 112string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 135string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 158string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 183string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 287string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 345string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 366string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 367string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one."); 384string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 385string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one."); 421string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 422string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one.");
Microsoft.ML.EntryPoints (1)
OneVersusAllMacro.cs (1)
108throw new Exception("Invalid input graph. Does not output predictor model.");
Microsoft.ML.Fairlearn (2)
Reductions\UtilityParity.cs (2)
50throw new Exception("ratio must lie between (0.1]"); 56throw new Exception("Only one of difference_bound and ratio_bound can be used");
Microsoft.ML.FastTree (1)
FastTreeRanking.cs (1)
850throw new Exception("Shifted NDCG / ContinuousWeightedRanknet / distanceWeight2 / normalized lambdas are only supported by unmanaged code");
Microsoft.ML.GenAI.Core (3)
Module\QuantizedLinear.cs (3)
21throw new Exception("Weight is not initialized"); 134throw new Exception("Quantization is not done yet"); 142throw new Exception("Weight is not initialized");
Microsoft.ML.PerformanceTests (7)
CacheDataViewBench.cs (2)
50throw new Exception($"Unexpected value {val} at {cursor.Position}"); 54throw new Exception($"Expected {Length} values in cache but only saw {count}");
HashBench.cs (4)
36throw new Exception(); 50throw new Exception(); 53throw new Exception(); 59throw new Exception();
Helpers\ExecuteMaml.cs (1)
14throw new Exception($"Command {command} returned negative error code");
Microsoft.ML.Sweeper (1)
Algorithms\KdoSweeper.cs (1)
148throw _host.Except(new Exception(errorMessage), errorMessage);
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
33throw new Exception("File not found");
Microsoft.ML.Tokenizers.Tests (1)
Utils.cs (1)
33throw new Exception("File not found");
Microsoft.ML.TorchSharp (1)
Utils\TorchUtils.cs (1)
41throw new Exception("Fallback to CPU is false but no GPU detected");
Microsoft.Svcutil.NamedPipeMetadataImporter (1)
NamedPipeMetadataImporter.cs (1)
93tcs.SetException(new Exception("Fault response received."));
Microsoft.VisualBasic.Core (10)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2483Throw New Exception 'would be nice to have an internal runtime exception or something like that
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (3)
287Return New Exception(Description) 295Return New Exception(Description) 299Return New Exception(Description)
Microsoft\VisualBasic\CompilerServices\IncompleteInitialization.vb (1)
10MyBase.New()
Microsoft\VisualBasic\FileIO\MalformedLineException.vb (5)
25MyBase.New() 35MyBase.New(message) 45MyBase.New(message) 56MyBase.New(message, innerException) 67MyBase.New(message, innerException)
Microsoft.VisualStudio.IntegrationTest.Setup (1)
TestTraceListener.cs (1)
101var reportedException = new Exception(message);
Microsoft.VisualStudio.LanguageServices (15)
CallHierarchy\Finders\AbstractCallFinder.cs (2)
98throw new Exception(string.Format(WorkspacesResources.The_symbol_0_cannot_be_located_within_the_current_solution, SymbolName)); 108throw new Exception(string.Format(WorkspacesResources.The_symbol_0_cannot_be_located_within_the_current_solution, SymbolName));
Progression\GraphBuilder.cs (1)
91FatalError.ReportAndCatch(new Exception("GetDocumentIdsWithFilePath returned a document in a project that does not exist."));
ProjectSystem\FileChangeTracker.cs (6)
197=> throw new Exception("We only watch files; we should never be seeing directory changes!"); 214=> throw new Exception("We only watch files; we should never be seeing directory changes!"); 217=> throw new Exception("We only watch files; we should never be seeing directory changes!"); 220=> throw new Exception("We only watch files; we should never be seeing directory changes!"); 230=> throw new Exception("We only watch files; we should never be seeing directory changes!"); 233=> throw new Exception("We only watch files; we should never be seeing directory changes!");
ProjectSystem\VisualStudioWorkspaceImpl.cs (5)
883throw new Exception(ServicesVSResources.Could_not_find_location_of_folder_on_disk); 904throw new Exception(ServicesVSResources.Could_not_find_location_of_folder_on_disk); 1231FatalError.ReportAndCatch(new Exception("Attempting to change the information of a document without a file path.")); 1460throw new Exception("Unable to check out the files from source control."); 1465throw new Exception("A file was reloaded during the source control checkout.");
TaskList\ProjectExternalErrorReporter.cs (1)
70FatalError.ReportAndCatch(new Exception("errorId is null"));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\SQLiteV2PersistentStorageTests.cs (1)
30throw new Exception();
MiddlewareAnalysisSample (1)
Startup.cs (1)
53throwApp.Run(context => { throw new Exception("Application Exception"); });
Mvc.RoutingWebSite (2)
Controllers\LinkParserController.cs (2)
23throw new Exception("Parsing failed."); 34throw new Exception("Parsing failed.");
PresentationBuildTasks (2)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (2)
238OnError(new Exception(SR.Format(SR.UnknownLanguage, cu.Language))); 748Exception compilerException = new Exception(message);
PresentationCore (8)
MS\Internal\TextFormatting\LineServicesCallbacks.cs (1)
3396Exception e = new System.Exception(SR.NonCLSException);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (1)
155Marshal.GetHRForException(new Exception());
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Interop\OSVersionHelper.cs (1)
319throw new Exception("OSVersionHelper.GetOsVersion Could not detect OS!");
System\Windows\Media\SolidColorBrush.cs (1)
156throw new Exception(SR.BrushUnknownBamlType);
System\Windows\Media\textformatting\TextFormatterContext.cs (1)
394throw new Exception(message);
System\Windows\Media\Visual.cs (3)
2881throw new Exception(SR.Effect_CombinedLegacyAndNew); 3013throw new Exception(SR.Effect_CombinedLegacyAndNew); 3110throw new Exception(SR.Effect_CombinedLegacyAndNew);
PresentationFramework (112)
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (1)
653throw new Exception(SR.UndefinedHighlightAnchor);
MS\Internal\AppModel\Journaling.cs (2)
539throw new Exception(SR.Format(SR.InvalidPageFunctionType, contentObject.GetType())); 680throw new Exception(SR.Format(SR.FailedResumePageFunction, this._typeName), ex);
MS\Internal\Documents\ParentUndoUnit.cs (1)
450throw new Exception(SR.UndoContainerTypeMismatch);
MS\Internal\PtsHost\Pts.cs (3)
66throw new Exception(SR.Format(SR.PTSError, fserr)); 125throw new Exception(SR.Format(SR.PTSError, fserr)); 160throw new Exception(SR.PTSInvalidHandle);
MS\Internal\PtsHost\PtsHost.cs (89)
166PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 204PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 247PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 277PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 308PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 335PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 369PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 404PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 430PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 465PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 500PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 526PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 556PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 609PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 639PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 667PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 696PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 720PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 746PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 772PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 795PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 833PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 860PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 983PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1006PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1041PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1080PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1113PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1172PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1210PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1238PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1337PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1397PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1456PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1576PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1636PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1671PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1694PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1740PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1769PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1797PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1835PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1939PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 1997PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2051PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2109PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2137PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2179PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2209PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2260PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2304PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2347PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2385PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2600PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2636PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2721PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2779PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2837PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 2864PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3036PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3094PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3152PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3281PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3311PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3346PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3376PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3407PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3439PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3470PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3502PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3532PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3563PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3603PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3639PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3673PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3704PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3732PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3760PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3788PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3817PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3856PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3906PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3949PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 3994PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 4052PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 4088PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 4115PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 4142PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception"); 4168PtsContext.CallbackException = new System.Exception("Caught a non CLS Exception");
MS\Internal\WindowsRuntime\Generated\WinRT\ExceptionHelpers.cs (2)
364e = new Exception(message, innerException); 368e = new Exception(messageResource);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Interop\OSVersionHelper.cs (1)
319throw new Exception("OSVersionHelper.GetOsVersion Could not detect OS!");
System\Windows\Annotations\AnnotationService.cs (1)
1285throw new Exception(SR.AnnotationAlreadyExistInService);
System\Windows\Application.cs (3)
419throw new Exception(SR.Format(SR.ContentTypeNotSupported, contentType)); 427throw new Exception(SR.Format(SR.UriNotMatchWithRootType, component.GetType( ), resourceLocator)); 494throw new Exception(SR.Format(SR.ContentTypeNotSupported, contentType.ToString()));
System\Windows\Controls\ItemContainerGenerator.cs (1)
1099Exception exception = new Exception(sb.ToString());
System\Windows\Controls\TextBox.cs (1)
1087throw new Exception(SR.TextBoxMinMaxLinesMismatch);
System\Windows\Data\XmlDataProvider.cs (1)
369throw new Exception(SR.WebRequestCreationFailed);
System\Windows\Navigation\NavigationService.cs (4)
112throw new Exception(SR.Format(SR.MustImplementIUriContext, typeof(IUriContext))); 583throw new Exception(SR.Format(SR.LoopDetected, _currentCleanSource)); 2626throw new Exception(SR.Format(SR.GetResponseFailed, requestUri.ToString())); 2859throw new Exception(SR.Format(SR.GetStreamFailed, requestUri.ToString()));
System\Windows\Standard\NativeMethods.cs (1)
1553throw new Exception("Unable to initialize GDI+");
System\Windows\StaticResourceExtension.cs (1)
90throw new Exception(SR.Format(SR.ParserNoResource, ResourceKey.ToString()));
ProjectCachePlugin (1)
AssemblyMockCache.cs (1)
74throw new Exception($"Cache plugin exception from {errorLocation}");
RazorPagesWebSite (4)
Pages\PropertyBinding\BindFormFile.cshtml.cs (4)
22throw new Exception($"{nameof(Property1)} is not bound."); 27throw new Exception($"{nameof(Form3)} is not bound."); 32throw new Exception($"{nameof(Forms.Form1)} is not bound."); 37throw new Exception($"{nameof(Forms.Form2)} is bound.");
Replay (4)
Replay.cs (3)
51throw new Exception($"Too many arguments: {string.Join(" ", rest)}"); 56throw new Exception("Missing binlogPath"); 165throw new Exception("Task was not in the list");
src\Compilers\Shared\BuildServerConnection.cs (1)
270throw new Exception(message, e);
Roslyn.Compilers.Extension (1)
CompilerPackage.cs (1)
155throw new Exception($"Unrecognized Visual Studio Version: {dte.Version}");
Roslyn.Test.PdbUtilities (8)
Reader\Token2SourceLineExporter.cs (8)
889throw new Exception( 1205throw new Exception("No `name' stream"); 1257throw new Exception("Unsupported PDB deleted bitset is not empty."); 1279throw new Exception(string.Format("Count mismatch. ({0} != {1})", j, cnt)); 1294throw new Exception(string.Format("Invalid signature. (sig={0})", sig)); 1342throw new Exception(string.Format("OEM section: guid={0} ti={1}", oem.idOem, oem.typind)); 1416throw new Exception(string.Format("Unsupported Name Stream version. (sig={0:x8}, ver={1})", sig, ver)); 1461throw new Exception(string.Format("Error reading DBI stream, pos={0} != {1}", bits.Position, end));
Roslyn.Test.Performance.Utilities (4)
Benchview.cs (1)
145throw new Exception($"submissionName was not provided, but submission type is {submissionType}");
RelativeDirectory.cs (1)
87throw new Exception("Couldn't find binaries. Are you running from the binaries directory?");
TestUtilities.cs (2)
111throw new System.Exception("ShellOutVital Failed"); 195throw new Exception("Shelling out failed");
RunTests (4)
HelixTestRunner.cs (2)
118throw new Exception($"Verify failed: {message}"); 402throw new Exception($@"Could not find global.json by walking up from ""{artifactsDir}"".");
ProcessTestExecutor.cs (1)
212throw new Exception($"Unable to run {workItemInfo.DisplayName} with {options.DotnetFilePath}. {ex}");
Program.cs (1)
332throw new Exception(message);
ScenarioTests.Common.Tests (2)
ScenarioTestTypes.cs (2)
710throw new Exception(input); 1283throw new Exception
Security.TransportSecurity.IntegrationTests (4)
Tcp\ClientCredentialTypeTests.OSX.cs (4)
128exception = new Exception($"The X.509 certificate ({GetCertificateId(certificate)}) usage time is invalid. " + 136exception = new Exception($"The X.509 certificate {GetCertificateId(certificate)} is not in the keychain file {ServiceUtilHelper.OSXCustomKeychainFilePath}."); 147exception = new Exception($"The X.509 certificate {GetCertificateId(certificate)} is not in the keychain file {ServiceUtilHelper.OSXCustomKeychainFilePath}."); 157exception = new Exception($"The {GetCertificateId(certificate)} X.509 certificate is in an untrusted certificate store.");
ServerComparison.FunctionalTests (1)
Helpers.cs (1)
29throw new Exception($"Solution root could not be found using {applicationBasePath}");
Shared.Tests (2)
Throw\ThrowTest.cs (2)
29var innerException = new Exception(); 52var innerException = new Exception();
Sockets.BindTests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
Sockets.FunctionalTests (11)
src\Servers\Kestrel\shared\test\StreamExtensions.cs (1)
67throw new Exception("Stream read 0.");
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
76throw new Exception($"Unexpected critical error. {log}", exception); 86throw new Exception($"Shutdown failure. {log}"); 94throw new Exception($"Unexpected connection error. {log}");
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (1)
22listenOptions.Use(next => context => throw new Exception());
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
891readTcs.SetException(new Exception("This shouldn't be reached.")); 1067readTcs.SetException(new Exception("This shouldn't be reached."));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (4)
233writeTcs.SetException(new Exception("This shouldn't be reached.")); 323writeTcs.SetException(new Exception("This shouldn't be reached.")); 540appFuncCompleted.SetException(new Exception("This shouldn't be reached.")); 799copyToAsyncCts.SetException(new Exception("This shouldn't be reached."));
StackDepthTest (1)
Program.cs (1)
85throw new Exception(diag[0].ToString());
System.ComponentModel.Composition (56)
Microsoft\Internal\ReflectionServices.cs (1)
89throw new Exception(SR.Diagnostic_InternalExceptionMessage);
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTraceSource.cs (1)
50throw new Exception(SR.Format(SR.Diagnostic_InternalExceptionMessage, SR.Diagnostic_TraceUnnecessaryWork));
System\ComponentModel\Composition\CompositionException.cs (1)
194throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ConstraintServices.cs (1)
90throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ContractNameServices.cs (6)
71throw new Exception(SR.Diagnostic_InternalExceptionMessage); 132throw new Exception(SR.Expecting_Empty_Queue); 248throw new Exception(SR.Expecting_Generic_Type); 270throw new Exception(SR.Expecting_AtleastOne_Type); 307throw new Exception(SR.Expecting_Empty_Queue); 351throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ExportServices.cs (1)
179throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
77throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
223throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs (2)
102throw new Exception(SR.Diagnostic_InternalExceptionMessage); 111throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
304throw new Exception(SR.Diagnostic_InternalExceptionMessage); 664throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
156throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (2)
582throw new Exception(SR.Diagnostic_InternalExceptionMessage); 589throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\CompositionService.cs (2)
52throw new Exception(SR.Diagnostic_InternalExceptionMessage); 61throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\CompositionServices.cs (2)
43throw new Exception(SR.Diagnostic_InternalExceptionMessage); 127throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (1)
571throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\ExportProvider.cs (1)
112throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs (1)
727throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\ImportEngine.cs (1)
723throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
263throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\MetadataViewGenerator.cs (3)
97throw new Exception(SR.Diagnostic_InternalExceptionMessage); 115throw new Exception(SR.Diagnostic_InternalExceptionMessage); 122throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\MetadataViewProvider.cs (1)
83throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (1)
64throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ExportfactoryCreator.cs (1)
37throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (3)
151throw new Exception(SR.Diagnostic_InternalExceptionMessage); 230throw new Exception(SR.Diagnostic_InternalExceptionMessage); 339throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (1)
71throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (1)
75throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (3)
31throw new Exception(SR.Diagnostic_InternalExceptionMessage); 106throw new Exception(SR.Diagnostic_InternalExceptionMessage); 132throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
409throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ReflectionExtensions.cs (7)
20throw new Exception(SR.Diagnostic_InternalExceptionMessage); 27throw new Exception(SR.Diagnostic_InternalExceptionMessage); 38throw new Exception(SR.Diagnostic_InternalExceptionMessage); 53throw new Exception(SR.Diagnostic_InternalExceptionMessage); 69throw new Exception(SR.Diagnostic_InternalExceptionMessage); 75throw new Exception(SR.Diagnostic_InternalExceptionMessage); 92throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System\ComponentModel\Composition\ReflectionModel\ReflectionProperty.cs (5)
26throw new Exception(SR.Diagnostic_InternalExceptionMessage); 68throw new Exception(SR.Diagnostic_InternalExceptionMessage); 105throw new Exception(SR.Diagnostic_InternalExceptionMessage); 120throw new Exception(SR.Diagnostic_InternalExceptionMessage); 130throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System.ComponentModel.Composition.Registration (4)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (2)
13throw new Exception(SR.Diagnostic_InternalExceptionMessage); 26throw new Exception(SR.Diagnostic_InternalExceptionMessage);
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTraceSource.cs (1)
50throw new Exception(SR.Format(SR.Diagnostic_InternalExceptionMessage, SR.Diagnostic_TraceUnnecessaryWork));
System\ComponentModel\Composition\Registration\RegistrationBuilder.cs (1)
192throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System.Composition.Convention (4)
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTrace.cs (2)
13throw new Exception(SR.Diagnostic_InternalExceptionMessage); 26throw new Exception(SR.Diagnostic_InternalExceptionMessage);
src\libraries\Common\src\System\Composition\Diagnostics\CompositionTraceSource.cs (1)
50throw new Exception(SR.Format(SR.Diagnostic_InternalExceptionMessage, SR.Diagnostic_TraceUnnecessaryWork));
System\Composition\Convention\ConventionBuilder.cs (1)
211throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System.Composition.Hosting (4)
System\Composition\Hosting\Core\CompositionOperation.cs (1)
96throw new Exception(SR.Sharing_Lock_Taken);
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
137throw new Exception(SR.Dependencies_Should_Be_Requested_Earlier);
System\Composition\Hosting\Core\UpdateResult.cs (1)
49throw new Exception(SR.Providers_Remain_To_Be_Queried);
System\Composition\Hosting\Util\Formatters.cs (1)
45throw new Exception(SR.Diagnostic_InternalExceptionMessage);
System.Formats.Cbor (6)
System\Formats\Cbor\CborConformanceLevel.cs (1)
270throw new Exception();
System\Formats\Cbor\Reader\CborReader.PeekState.cs (3)
39throw new Exception(); 85throw new Exception(); 130throw new Exception();
System\Formats\Cbor\Writer\CborWriter.cs (1)
410throw new Exception();
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
198throw new Exception();
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
534throw new Exception();
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
274throw new Exception();
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
77throw new Exception($"Not able to find {newFullNamespaceName} namespace");
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\DataContract.cs (4)
421throw new Exception(ex.Message, ex); 892throw new Exception(ex.Message, ex); 910throw new Exception(ex.Message, ex); 922throw new Exception(ex.Message, ex);
System.Private.Xml (3)
System\Xml\BinaryXml\XmlBinaryReader.cs (2)
3200throw new Exception("Prefix not interned: \'" + decl.prefix + "\'"); 3202throw new Exception("Uri not interned: \'" + decl.uri + "\'");
System\Xml\Serialization\Compilation.cs (1)
175throw new Exception(SR.Format(SR.FailLoadAssemblyUnderPregenMode, serializerName));
System.Reflection.MetadataLoadContext (1)
System\CoreRtBridge.cs (1)
34internal static Exception CreateMissingMetadataException() => new Exception();
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
92return ThrowHelperError(new Exception(message, innerException));
System.ServiceModel.Federation (1)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (1)
143throw new Exception("ThrowIfClosedOrNotOpen: Unknown CommunicationObject.state");
System.ServiceModel.NetFramingBase (2)
System\ServiceModel\Channels\FramingChannels.cs (1)
402throw new Exception("invalid framing client state machine");
System\ServiceModel\Channels\SessionConnectionReader.cs (1)
102throw new Exception("Receive: DecodeMessage() should consume the outstanding buffer or return a message.");
System.ServiceModel.Primitives.Tests (1)
Security\SecurityNegotiationExceptionTest.cs (1)
20Exception innerException = new Exception(exceptionMessage);
System.Text.Json (2)
System\ReflectionExtensions.cs (1)
157throw new Exception();
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (1)
72throw new Exception();
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Emitter.cs (1)
1504_ => throw new Exception(),
System.Threading.Channels (1)
System\Threading\Channels\ChannelUtilities.cs (1)
14internal static readonly Exception s_doneWritingSentinel = new Exception(nameof(s_doneWritingSentinel));
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\TaskReplicator.cs (1)
143throw new Exception("Replicated tasks cannot yield in this single-threaded browser environment");
UIAutomationTypes (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Interop\OSVersionHelper.cs (1)
319throw new Exception("OSVersionHelper.GetOsVersion Could not detect OS!");
vbc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
270throw new Exception(message, e);
VBCSCompiler (3)
src\Compilers\Server\VBCSCompiler\BuildServerController.cs (1)
49throw new Exception("Cannot calculate pipe name");
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnection.cs (1)
61throw new Exception("Client identity does not match server identity.");
src\Compilers\Shared\BuildServerConnection.cs (1)
270throw new Exception(message, e);
VBCSCompiler.UnitTests (19)
AnalyzerConsistencyCheckerTests.cs (2)
252public Assembly LoadFromPath(string fullPath) => throw new Exception(); 253public string? GetOriginalDependencyLocation(AssemblyName assembly) => throw new Exception();
ClientConnectionHandlerTests.cs (6)
27var compilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 43throw new Exception(""); 48ReadBuildRequestFunc = _ => throw new Exception(), 67throw new Exception(""); 87throw new Exception(""); 123throw new Exception("");
CompilerServerTests.cs (6)
313var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 326var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 343var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 365var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 389var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 411var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); });
NamedPipeTestUtil.cs (2)
33throw new Exception("Cannot locate the SharedServer dictionary"); 45throw new Exception("Socket is unexpectedly null");
TestableClientConnection.cs (2)
22public Func<CancellationToken, Task<BuildRequest>> ReadBuildRequestFunc = delegate { throw new Exception(); }; 23public Func<BuildResponse, CancellationToken, Task> WriteBuildResponseFunc = delegate { throw new Exception(); };
VBCSCompilerServerTests.cs (1)
374throw new Exception("");
WindowsBase.Tests (15)
Helpers.cs (1)
66throw new Exception("Not reachable.");
System\Security\RightsManagement\RightsManagementExceptionTests.cs (8)
67yield return new object?[] { RightsManagementFailureCode.ServerError, new Exception() }; 70yield return new object?[] { RightsManagementFailureCode.Success - 1, new Exception() }; 121yield return new object?[] { "message", new Exception() }; 142yield return new object?[] { new Exception() }; 163yield return new object?[] { RightsManagementFailureCode.ServerError, "message", new Exception() }; 166yield return new object?[] { RightsManagementFailureCode.Success - 1, "message", new Exception() }; 187yield return new object?[] { RightsManagementFailureCode.ServerError, new Exception() }; 190yield return new object?[] { RightsManagementFailureCode.Success - 1, new Exception() };
System\Windows\Data\DataSourceProviderTests.cs (6)
1239provider.OnQueryFinished(new object(), new Exception(), e => e, new object()); 1456var error = new Exception(); 1534var error = new Exception(); 1664var error1 = new Exception(); 1667var error2 = new Exception(); 1833provider.OnQueryFinished(new object(), new Exception(), e => e, new object());
12791 references to Exception
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
400catch (Exception e)
Aspire.Azure.Data.Tables.Tests (1)
ConformanceTests.cs (1)
134catch (Exception)
Aspire.Azure.Messaging.EventHubs (1)
EventHubsComponent.cs (1)
69catch (Exception ex) when (ex is FormatException or IndexOutOfRangeException)
Aspire.Azure.Messaging.ServiceBus.Tests (2)
ConformanceTests_Queue.cs (1)
55catch (Exception)
ConformanceTests_Topic.cs (1)
56catch (Exception)
Aspire.Azure.Messaging.WebPubSub (1)
AspireWebPubSubExtensions.cs (1)
146catch (Exception ex)
Aspire.Azure.Search.Documents (1)
AzureSearchIndexHealthCheck.cs (1)
29catch (Exception ex)
Aspire.Azure.Security.KeyVault.Tests (1)
ConformanceTests.cs (1)
123catch (Exception)
Aspire.Azure.Storage.Blobs.Tests (1)
ConformanceTests.cs (1)
134catch (Exception)
Aspire.Azure.Storage.Queues.Tests (1)
ConformanceTests.cs (1)
136catch (Exception)
Aspire.Components.Common.Tests (2)
ConformanceTests.cs (2)
288catch (Exception) { } 448catch (Exception) when (!CanConnectToServer)
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\OpenTelemetryConsumeResultExtensions.cs (1)
132catch (Exception ex)
Aspire.Dashboard (21)
Components\Pages\ConsoleLogs.razor.cs (1)
128catch (Exception ex)
Model\BrowserStorage\BrowserStorageBase.cs (1)
34catch (Exception ex)
Model\BrowserStorage\LocalBrowserStorage.cs (1)
38catch (Exception ex)
Otlp\Model\OtlpApplication.cs (4)
80catch (Exception ex) 122catch (Exception ex) 136catch (Exception ex) 150catch (Exception ex)
Otlp\Storage\Subscription.cs (1)
104catch (Exception ex)
Otlp\Storage\TelemetryRepository.cs (7)
277catch (Exception ex) 304catch (Exception ex) 367catch (Exception ex) 762catch (Exception ex) 810catch (Exception ex) 832catch (Exception ex) 990catch (Exception ex)
ResourceService\DashboardClient.cs (2)
254catch (Exception ex) 270catch (Exception ex)
ResourceService\Partials.cs (1)
55catch (Exception ex)
src\Shared\IConfigurationExtensions.cs (2)
79catch (Exception ex) 116catch (Exception ex)
src\Shared\TaskHelpers.cs (1)
35catch (Exception ex) when (logger is not null)
Aspire.Dashboard.Components.Tests (9)
tests\Shared\Logging\TestLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (2)
29Exception? exception, 30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (2)
14public Exception? Exception { get; set; } 16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (3)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 105catch (Exception)
Aspire.Dashboard.Tests (11)
Integration\ServerRetryHelper.cs (1)
50catch (Exception ex)
TelemetryRepositoryTests\TraceTests.cs (1)
920catch (Exception ex)
tests\Shared\Logging\TestLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (2)
29Exception? exception, 30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (2)
14public Exception? Exception { get; set; } 16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (3)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 105catch (Exception)
Aspire.Elastic.Clients.Elasticsearch (1)
ElasticsearchHealthCheck.cs (1)
33catch (Exception ex)
Aspire.EndToEnd.Tests (3)
tests\Shared\WorkloadTesting\BuildEnvironment.cs (1)
246catch (Exception ex)
tests\Shared\WorkloadTesting\ProjectInfo.cs (1)
51catch (Exception ex)
tests\Shared\WorkloadTesting\ToolCommand.cs (1)
177catch (Exception ex)
Aspire.Hosting (46)
ApplicationModel\ResourceExtensions.cs (6)
259Action<object?, string?, Exception?> processValue, 298catch (Exception ex) 309Action<string, object?, string?, Exception?> processValue, 347catch (Exception ex) 357Action<string?, Exception?> processValue, 390catch (Exception ex)
ApplicationModel\ResourceLoggerService.cs (4)
116public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 540public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
ApplicationModel\UserSecretsParameterDefault.cs (1)
51catch (Exception) { }
Dashboard\DashboardLifecycleHook.cs (3)
86catch (Exception ex) 335catch (Exception ex) 393catch (Exception ex)
Dashboard\DashboardService.cs (1)
195catch (Exception ex)
Dashboard\DashboardServiceData.cs (2)
73catch (Exception ex) when (ex is not OperationCanceledException) 112catch (Exception ex)
Dashboard\DashboardServiceHost.cs (1)
125catch (Exception ex)
Dcp\DcpDependencyCheck.cs (1)
109catch (Exception ex) when (ex is not DistributedApplicationException)
Dcp\DcpExecutor.cs (8)
171catch (Exception ex) 190catch (Exception ex) 306catch (Exception ex) 476catch (Exception ex) 929catch (Exception ex) 939catch (Exception ex) 1139catch (Exception ex) 1549catch (Exception ex)
Dcp\DcpHost.cs (1)
147catch (Exception ex)
Dcp\DcpPipelineBuilder.cs (2)
22ShouldHandle = new PredicateBuilder().Handle<Exception>(), 47ShouldHandle = new PredicateBuilder().Handle<Exception>(),
Dcp\HostDashboardEndpointProvider.cs (1)
23catch (Exception ex)
Dcp\KubernetesService.cs (5)
359Func<Exception, bool> isRetryable, 374Func<Exception, bool> isRetryable, 391catch (Exception e) when (isRetryable(e)) 411private static bool RetryOnConnectivityErrors(Exception ex) => ex is HttpRequestException || ex is KubeConfigException; 412private static bool RetryOnConnectivityAndConflictErrors(Exception ex) =>
Dcp\ResourceLogSource.cs (1)
94catch (Exception ex)
Devcontainers\Codespaces\CodespacesResourceUrlRewriterService.cs (1)
67catch (Exception ex) when (!stoppingToken.IsCancellationRequested)
DistributedApplicationException.cs (1)
32public DistributedApplicationException(string message, Exception inner) : base(message, inner) { }
DistributedApplicationOptions.cs (1)
108catch (Exception ex)
Exceptions.cs (1)
10public FailedToApplyEnvironmentException(string message, Exception inner) : base(message, inner) { }
Health\ResourceHealthCheckService.cs (1)
165catch (Exception ex) when (!cancellationToken.IsCancellationRequested)
Orchestrator\OrchestratorHostService.cs (1)
63catch (Exception ex)
src\Shared\IConfigurationExtensions.cs (2)
79catch (Exception ex) 116catch (Exception ex)
src\Shared\TaskHelpers.cs (1)
35catch (Exception ex) when (logger is not null)
Aspire.Hosting.Azure (5)
Exceptions.cs (2)
10public AzureCliNotOnPathException(string message, Exception inner) : base(message, inner) { } 17public FailedToApplyEnvironmentException(string message, Exception inner) : base(message, inner) { }
Provisioning\Provisioners\AzureProvisioner.cs (3)
152catch (Exception) 330catch (Exception ex) 471catch (Exception)
Aspire.Hosting.Azure.ServiceBus (1)
ServiceBusHealthCheck.cs (1)
49catch (Exception ex)
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
356catch (Exception ex)
Aspire.Hosting.Elasticsearch (1)
src\Components\Aspire.Elastic.Clients.Elasticsearch\ElasticsearchHealthCheck.cs (1)
33catch (Exception ex)
Aspire.Hosting.Nats (1)
src\Components\Aspire.NATS.Net\NatsHealthCheck.cs (1)
31catch (Exception)
Aspire.Hosting.Qdrant (1)
src\Components\Aspire.Qdrant.Client\QdrantHealthCheck.cs (1)
28catch (Exception ex)
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
377catch (Exception ex)
Aspire.Hosting.Testing (13)
DistributedApplicationEntryPointInvoker.cs (9)
23Action<Exception?>? entryPointCompleted = null) 53private readonly Action<Exception?>? _entryPointCompleted; 61Action<Exception?>? entryPointCompleted) 80Exception? exception = null; 110catch (Exception ex) 139public void OnError(Exception error) 172public void OnError(Exception error) 242void IObserver<DiagnosticListener>.OnError(Exception error) 265void IObserver<KeyValuePair<string, object?>>.OnError(Exception error)
DistributedApplicationFactory.cs (4)
307catch (Exception exception) 330private void OnEntryPointExit(Exception? exception) 357private void OnException(Exception exception) 470catch (Exception exception)
Aspire.Hosting.Testing.Tests (10)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
144catch (Exception ex)
tests\Shared\Logging\TestLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (2)
29Exception? exception, 30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (2)
14public Exception? Exception { get; set; } 16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (3)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 105catch (Exception)
Aspire.Hosting.Tests (15)
Dashboard\DashboardResourceTests.cs (2)
542public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
DistributedApplicationTests.cs (2)
821await Assert.ThrowsAnyAsync<Exception>(async () => 892catch (Exception ex) when (ex is not EqualException)
tests\Shared\Logging\TestLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (2)
29Exception? exception, 30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (2)
14public Exception? Exception { get; set; } 16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (3)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 105catch (Exception)
Utils\LoggerNotificationExtensions.cs (1)
144catch (Exception ex)
Utils\PasswordGeneratorTests.cs (1)
111Exception exception = Record.Exception(() => new Uri($"https://guest:{password}@localhost:12345"));
Aspire.Microsoft.Data.SqlClient (16)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientDiagnosticListener.cs (4)
36private readonly PropertyFetcher<Exception> exceptionFetcher = new("Exception"); 88catch (Exception ex) 137catch (Exception ex) 181if (this.exceptionFetcher.TryFetch(payload, out Exception exception) && exception != null)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientInstrumentationEventSource.cs (3)
18public void UnknownErrorProcessingEvent(string handlerName, string eventName, Exception ex) 51public void EnrichmentException(Exception ex) 72public void CommandFilterException(Exception ex)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceListener.cs (4)
15private readonly Action<string, string, Exception> logUnknownException; 17public DiagnosticSourceListener(ListenerHandler handler, Action<string, string, Exception> logUnknownException) 29public void OnError(Exception error) 44catch (Exception ex)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (4)
17private readonly Action<string, string, Exception> logUnknownException; 24Action<string, string, Exception> logUnknownException) 33Action<string, string, Exception> logUnknownException) 74public void OnError(Exception error)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (1)
18public static string ToInvariantString(this Exception exception)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (1)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (1)
196var exception = Record.Exception(() => builder.AddCosmosDbContext<TestDbContext>("cosmos", "databaseName"));
Aspire.Microsoft.EntityFrameworkCore.SqlServer (16)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientDiagnosticListener.cs (4)
36private readonly PropertyFetcher<Exception> exceptionFetcher = new("Exception"); 88catch (Exception ex) 137catch (Exception ex) 181if (this.exceptionFetcher.TryFetch(payload, out Exception exception) && exception != null)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Implementation\SqlClientInstrumentationEventSource.cs (3)
18public void UnknownErrorProcessingEvent(string handlerName, string eventName, Exception ex) 51public void EnrichmentException(Exception ex) 72public void CommandFilterException(Exception ex)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceListener.cs (4)
15private readonly Action<string, string, Exception> logUnknownException; 17public DiagnosticSourceListener(ListenerHandler handler, Action<string, string, Exception> logUnknownException) 29public void OnError(Exception error) 44catch (Exception ex)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (4)
17private readonly Action<string, string, Exception> logUnknownException; 24Action<string, string, Exception> logUnknownException) 33Action<string, string, Exception> logUnknownException) 74public void OnError(Exception error)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (1)
18public static string ToInvariantString(this Exception exception)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (1)
AspireSqlServerEFCoreSqlClientExtensionsTests.cs (1)
297var exception = Record.Exception(() => builder.AddSqlServerDbContext<TestDbContext>("sqlconnection"));
Aspire.Milvus.Client (1)
MilvusHealthCheck.cs (1)
30catch (Exception ex)
Aspire.NATS.Net (1)
NatsHealthCheck.cs (1)
31catch (Exception)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (1)
AspireEFPostgreSqlExtensionsTests.cs (1)
304var exception = Record.Exception(() => builder.AddNpgsqlDbContext<TestDbContext>("npgsql"));
Aspire.Oracle.EntityFrameworkCore.Tests (2)
AspireOracleEFCoreDatabaseExtensionsTests.cs (1)
298var exception = Record.Exception(() => builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection"));
ConformanceTests.cs (1)
172catch (Exception) when (!CanConnectToServer)
Aspire.Playground.Tests (10)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
144catch (Exception ex)
tests\Shared\Logging\TestLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
tests\Shared\Logging\TestLoggerT.cs (2)
29Exception? exception, 30Func<TState, Exception?, string> formatter)
tests\Shared\Logging\WriteContext.cs (2)
14public Exception? Exception { get; set; } 16public Func<object?, Exception?, string>? Formatter { get; set; }
tests\Shared\Logging\XunitLoggerProvider.cs (3)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 105catch (Exception)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (1)
AspireEFMySqlExtensionsTests.cs (1)
292var exception = Record.Exception(() => builder.AddMySqlDbContext<TestDbContext>("mysql"));
Aspire.Qdrant.Client (1)
QdrantHealthCheck.cs (1)
28catch (Exception ex)
Aspire.RabbitMQ.Client (6)
src\Components\Aspire.RabbitMQ.Client\AspireRabbitMQExtensions.cs (4)
157catch (Exception ex) 167private sealed class FailedHealthCheck(Exception ex) : IHealthCheck 221catch (Exception ex) 246private static void AddRabbitMQExceptionTags(Activity? connectAttemptActivity, Exception ex)
src\Components\Aspire.RabbitMQ.Client\RabbitMQEventSourceLogForwarder.cs (2)
13private static readonly Func<ErrorEventSourceEvent, Exception?, string> s_formatErrorEvent = FormatErrorEvent; 56private static string FormatErrorEvent(ErrorEventSourceEvent eventSourceEvent, Exception? ex) =>
Aspire.RabbitMQ.Client.Tests (7)
AspireRabbitMQLoggingTests.cs (7)
118Exception testException; 123catch (Exception ex) 163Exception testException; 169catch (Exception ex) 222private static void LogError(string message, Exception ex) 248public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Aspire.RabbitMQ.Client.v7.Tests (8)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (8)
118Exception testException; 123catch (Exception ex) 163Exception testException; 169catch (Exception ex) 222private static void LogError(string message, Exception ex) 227s_log.GetType().GetMethod("Error", [typeof(string), typeof(Exception)])!.Invoke(s_log, new object[] { message, ex }); 248public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Aspire.Workload.Tests (4)
StarterTemplateRunTestsBase.cs (1)
108catch (Exception ex)
tests\Shared\WorkloadTesting\BuildEnvironment.cs (1)
246catch (Exception ex)
tests\Shared\WorkloadTesting\ProjectInfo.cs (1)
51catch (Exception ex)
tests\Shared\WorkloadTesting\ToolCommand.cs (1)
177catch (Exception ex)
AzureSearch.ApiService (1)
Program.cs (1)
163catch (Exception ex)
BasicTestApp (2)
PrependMessageLoggerProvider.cs (2)
58public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Binding.Tcp.IntegrationTests (2)
OperationContextAsyncFlowTests.cs (2)
147public Exception Exception { get; private set; } 167catch (Exception e)
BuildBoss (6)
CompilerNuGetCheckerUtil.cs (1)
81catch (Exception ex)
OptProfCheckerUtil.cs (2)
55catch (Exception ex) 113catch (Exception)
Program.cs (2)
24catch (Exception ex) 58catch (Exception ex)
StructuredLoggerCheckerUtil.cs (1)
55catch (Exception ex)
BuildValidator (6)
DemoLogger.cs (4)
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 73public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Program.cs (2)
170catch (Exception ex) 355catch (Exception ex)
Client.ClientBase.IntegrationTests (9)
MessageInspectorTestHelpers.cs (1)
58catch (Exception)
SessionTests.cs (8)
200catch (Exception e) 311ResultsVerificationHelper<Exception>(canMakeServiceCall: true, cbClosedCalled: false, cbClosingCalled: false, cbFaultedCalled: false); 333ResultsVerificationHelper<Exception>(canMakeServiceCall: true, cbClosedCalled: false, cbClosingCalled: false, cbFaultedCalled: false); 406ResultsVerificationHelper<Exception>(canMakeServiceCall: true, cbClosedCalled: false, cbClosingCalled: false, cbFaultedCalled: false); 429ResultsVerificationHelper<Exception>(canMakeServiceCall: true, cbClosedCalled: false, cbClosingCalled: false, cbFaultedCalled: false); 472catch (Exception e) 537where ExpectedException : Exception 553catch (Exception e)
Client.ExpectedExceptions.IntegrationTests (9)
ExpectedExceptionTests.4.0.0.cs (3)
244Exception[] exceptions = new Exception[operationCount]; 337catch (Exception ex)
ExpectedExceptionTests.4.1.0.cs (4)
112catch (Exception ex) 494Exception[] exceptions = new Exception[operationCount]; 587catch (Exception ex)
ExpectedExceptionTests.4.1.1.cs (2)
27var exception = Assert.Throws<Exception>(() =>
ClientSample (8)
HubSample.cs (1)
110catch (Exception ex)
Tcp\TcpConnection.cs (7)
75Exception sendError = null; 98catch (Exception ex) 110Exception error = null; 142catch (Exception ex) 183private async Task<Exception> DoSend() 185Exception error = null; 203catch (Exception ex)
CodeStyleConfigFileGenerator (3)
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
Contract.Service.IntegrationTests (12)
ServiceContractTests.4.1.0.cs (12)
705Exception exception1 = null; 706Exception exception2 = null; 719catch (Exception e) 728catch (Exception e) 795Exception exception1 = null; 796Exception exception2 = null; 809catch (Exception e) 818catch (Exception e) 886Exception exception1 = null; 887Exception exception2 = null; 900catch (Exception e) 909catch (Exception e)
Contract.XmlSerializer.IntegrationTests (10)
XmlSerializerFormatTest.cs (10)
93catch (Exception exception) 115catch (Exception exception) 147catch (Exception ex) 195catch (Exception ex) 243catch (Exception ex) 291catch (Exception ex) 347catch (Exception ex) 404catch (Exception ex) 461catch (Exception ex) 499catch (Exception ex)
Crossgen2Tasks (5)
CommonFilePulledFromSdkRepo\BuildErrorException.cs (1)
23public BuildErrorException(string message, Exception innerException) : base(message, innerException)
CommonFilePulledFromSdkRepo\TaskBase.cs (4)
41catch (Exception e) 50private void LogErrorTelemetry(string eventName, Exception e) 57private static string ExceptionToStringWithoutMessage(Exception e) 84private static string NonAggregateExceptionToStringWithoutMessage(Exception e)
csc (17)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (4)
57internal static void LogException(this ICompilerServerLogger logger, Exception exception, string reason) 69Exception? e = exception.InnerException; 80void AppendException(Exception exception) 136catch (Exception e)
src\Compilers\Shared\BuildClient.cs (2)
181catch (Exception ex) 245catch (Exception ex)
src\Compilers\Shared\BuildServerConnection.cs (11)
129catch (Exception) 141catch (Exception) 289catch (Exception e) 314catch (Exception e) 358catch (Exception e) 402catch (Exception e) when (e is IOException || e is TimeoutException) 428catch (Exception e) when (!(e is TaskCanceledException || e is OperationCanceledException)) 727catch (Exception) 774catch (Exception) 806catch (Exception) 825catch (Exception)
CSharpSyntaxGenerator (1)
Program.cs (1)
103catch (Exception ex)
csi (1)
Csi.cs (1)
46catch (Exception ex)
DatabaseMigration.MigrationService (1)
ApiDbInitializer.cs (1)
32catch (Exception ex)
DependencyInjectionApp (1)
Program.cs (1)
33catch (Exception ex)
DesignSurface (2)
MainForm.cs (1)
415catch (Exception)
Program.cs (1)
35catch (Exception ex)
DesignSurfaceExt (7)
DesignSurfaceExt.cs (4)
155catch (Exception ex) 191catch (Exception ex) 226catch (Exception ex) 370catch (Exception ex)
NameCreationServiceImp.cs (1)
44catch (Exception) { }
TabOrderHooker.cs (2)
38catch (Exception ex) 59catch (Exception ex)
Diagnostics.EFCore.FunctionalTests (6)
DatabaseErrorPageMiddlewareTest.cs (4)
182catch (Exception e) 402catch (Exception exception) 450catch (Exception exception) 510catch (Exception ex)
Helpers\TestLoggerProvider.cs (2)
43public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
dotnet-dev-certs (29)
Program.cs (2)
231catch (Exception exception) 266catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
dotnet-getdocument (2)
src\Tools\GetDocumentInsider\src\CommandException.cs (1)
15public CommandException(string message, Exception innerException)
src\Tools\GetDocumentInsider\src\ProgramBase.cs (1)
54catch (Exception ex)
dotnet-openapi (5)
Application.cs (2)
63foreach (var innerException in ex.InnerExceptions) 90catch (Exception ex)
Commands\BaseCommand.cs (2)
321catch (Exception exception) 569catch (Exception ex)
Program.cs (1)
33catch (Exception ex)
dotnet-sql-cache (4)
Program.cs (4)
143catch (Exception exception) 190catch (Exception ex) 246catch (Exception ex) 266catch (Exception ex)
dotnet-svcutil.xmlserializer (20)
Microsoft\Tools\ServiceModel\SvcUtil\ExportModule.cs (1)
72catch (Exception e)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (4)
94catch (Exception e) 140Exception ie = tie.InnerException; 222catch (Exception e) 241foreach (Exception e in rtle.LoaderExceptions)
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (4)
203catch (Exception e) 372catch (Exception e) 449catch (Exception e) 463catch (Exception e)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (2)
91catch (Exception e) 110catch (Exception e)
Microsoft\Tools\ServiceModel\SvcUtil\Tool.cs (2)
42catch (Exception e) 75internal static bool IsFatal(Exception exception)
Microsoft\Tools\ServiceModel\SvcUtil\ToolArgumentException.cs (1)
30internal ToolArgumentException(String message, Exception innerException) : base(message, innerException)
Microsoft\Tools\ServiceModel\SvcUtil\ToolConsole.cs (3)
51private static void WriteError(Exception e) 56internal static void WriteUnexpectedError(Exception e) 95internal static void WriteError(Exception e, string prefix)
Microsoft\Tools\ServiceModel\SvcUtil\ToolInputException.cs (1)
30internal ToolInputException(String message, Exception innerException) : base(message, innerException)
Microsoft\Tools\ServiceModel\SvcUtil\ToolOptionException.cs (1)
18internal ToolOptionException(string message, Exception e) : base(message, e) { }
Microsoft\Tools\ServiceModel\SvcUtil\ToolRuntimeException.cs (1)
29internal ToolRuntimeException(String message, Exception innerException) : base(message, innerException)
dotnet-svcutil.xmlserializer.IntegrationTests (10)
src\System.Private.ServiceModel\tests\Scenarios\Contract\XmlSerializer\XmlSerializerFormatTest.cs (10)
93catch (Exception exception) 115catch (Exception exception) 147catch (Exception ex) 195catch (Exception ex) 243catch (Exception ex) 291catch (Exception ex) 347catch (Exception ex) 404catch (Exception ex) 461catch (Exception ex) 499catch (Exception ex)
dotnet-svcutil-lib (948)
AppInsightsTelemetryClient.cs (2)
124catch (Exception ex) 205public void TrackError(string eventName, Exception exceptionObject)
CodeDomFixup\CodeDomVisitors\CreateCallbackImpl.cs (1)
353ctor.Parameters.Add(new CodeParameterDeclarationExpression(typeof(Exception), "exception"));
CodeSerializer.cs (3)
49catch (Exception e) 73catch (Exception e) 104catch (Exception e)
CommandLineParser.cs (1)
199catch (Exception ex)
CommandProcessorOptions.cs (4)
242catch (Exception ex) 960catch (Exception ex) 973catch (Exception ex) 996catch (Exception ex)
FrameworkFork\Microsoft.CodeDom\Configuration\ConfigurationErrorsException.cs (1)
19public ConfigurationErrorsException(string message, Exception innerException) : base(message, innerException)
FrameworkFork\Microsoft.CodeDom\System\CodeCatchClause.cs (1)
87_catchExceptionType = new CodeTypeReference(typeof(System.Exception));
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (4)
4479private Exception ThrowUnexpectedToken(BinXmlToken token) 4485private Exception ThrowXmlException(string res) 4497private Exception ThrowXmlException(string res, string arg1, string arg2) 4503private Exception ThrowNotSupported(string res)
FrameworkFork\Microsoft.Xml\Xml\Core\IDtdParserAdapter.cs (1)
52void Throw(Exception e);
FrameworkFork\Microsoft.Xml\Xml\Core\IValidationEventHandling.cs (1)
18void SendEvent(Exception exception, XmlSeverityType severity);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (4)
1566internal Exception CreateReadContentAsException(string methodName) 1571internal Exception CreateReadElementContentAsException(string methodName) 1581static internal Exception CreateReadContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo lineInfo) 1586static internal Exception CreateReadElementContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo lineInfo)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (9)
2700internal void DtdParserProxy_Throw(Exception e) 2767private void Throw(string res, string arg, Exception innerException) 2772private void Throw(string res, string[] args, Exception innerException) 2777private void Throw(Exception e) 2788private void ReThrow(Exception e, int lineNo, int linePos) 2790Throw(new XmlException(e.Message, (Exception)null, lineNo, linePos, _ps.baseUriStr)); 2803private void ThrowWithoutLineInfo(string res, string[] args, Exception innerException) 8049catch (Exception) 8065catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImplHelpers.cs (1)
297void IDtdParserAdapter.Throw(Exception e)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlValidatingReaderImpl.cs (1)
59void IValidationEventHandling.SendEvent(Exception /*XmlSchemaException*/ exception, XmlSeverityType severity)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (1)
2183private static Exception InvalidCharsException(string name, int badCharIndex)
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlLoader.cs (1)
1005static internal Exception UnexpectedNodeType(XmlNodeType nodetype)
FrameworkFork\Microsoft.Xml\Xml\schema\BaseProcessor.cs (1)
242protected void SendValidationEvent(string code, string[] args, Exception innerException, XmlSchemaObject source)
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (74)
550Exception exception = TryParseValue(s, nameTable, nsmgr, out typedValue); 568Exception exception = TryParseValue(s, nameTable, nsmgr, out typedValue); 581internal override Exception TryParseValue(object value, XmlNameTable nameTable, IXmlNamespaceResolver namespaceResolver, out object typedValue) 583Exception exception = null; 1047internal override Exception TryParseValue(object value, XmlNameTable nameTable, IXmlNamespaceResolver namespaceResolver, out object typedValue) 1049Exception exception; 1125internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1127Exception exception; 1267internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1269Exception exception; 1303internal override Exception TryParseValue(object value, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1305Exception exception; 1402internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1483internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1485Exception exception; 1557internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1559Exception exception; 1642internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1644Exception exception; 1731internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1733Exception exception; 1825internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1827Exception exception; 1916internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1918Exception exception; 1947internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1949Exception exception; 1985internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 1987Exception exception; 2077internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2079Exception exception; 2462internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2464Exception exception; 2563internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2565Exception exception; 2670internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2672Exception exception; 2756internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2758Exception exception; 2956internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 2958Exception exception; 3092internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3094Exception exception; 3172internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3174Exception exception; 3290internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3292Exception exception; 3346internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3348Exception exception; 3403internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3405Exception exception; 3459internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3461Exception exception; 3547internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3549Exception exception; 3603internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3605Exception exception; 3659internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3661Exception exception; 3714internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3716Exception exception; 3771catch (Exception e) 3792catch (Exception e) 3830catch (Exception e) 3873catch (Exception e) 3879internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3881Exception exception; 3902Exception exception; 3917catch (Exception e) 3925internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3927Exception exception; 3974catch (Exception e) 3980internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue) 3982Exception exception;
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (2)
550catch (Exception) 615catch (Exception)
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (43)
368catch (Exception e) 669Exception ex = datatype.TryParseValue(facet.Value, nameTable, nsmgr, out typedValue); 781internal virtual Exception CheckLexicalFacets(ref string parseString, XmlSchemaDatatype datatype) 786internal virtual Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 790internal virtual Exception CheckValueFacets(decimal value, XmlSchemaDatatype datatype) 794internal virtual Exception CheckValueFacets(Int64 value, XmlSchemaDatatype datatype) 798internal virtual Exception CheckValueFacets(Int32 value, XmlSchemaDatatype datatype) 802internal virtual Exception CheckValueFacets(Int16 value, XmlSchemaDatatype datatype) 806internal virtual Exception CheckValueFacets(byte value, XmlSchemaDatatype datatype) 810internal virtual Exception CheckValueFacets(DateTime value, XmlSchemaDatatype datatype) 814internal virtual Exception CheckValueFacets(double value, XmlSchemaDatatype datatype) 818internal virtual Exception CheckValueFacets(float value, XmlSchemaDatatype datatype) 822internal virtual Exception CheckValueFacets(string value, XmlSchemaDatatype datatype) 826internal virtual Exception CheckValueFacets(byte[] value, XmlSchemaDatatype datatype) 830internal virtual Exception CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 834internal virtual Exception CheckValueFacets(XmlQualifiedName value, XmlSchemaDatatype datatype) 876internal Exception CheckPatternFacets(RestrictionFacets restriction, string value) 1005internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1011internal override Exception CheckValueFacets(decimal value, XmlSchemaDatatype datatype) 1068internal override Exception CheckValueFacets(Int64 value, XmlSchemaDatatype datatype) 1074internal override Exception CheckValueFacets(Int32 value, XmlSchemaDatatype datatype) 1079internal override Exception CheckValueFacets(Int16 value, XmlSchemaDatatype datatype) 1084internal override Exception CheckValueFacets(byte value, XmlSchemaDatatype datatype) 1105internal Exception CheckTotalAndFractionDigits(decimal value, int totalDigits, int fractionDigits, bool checkTotal, bool checkFraction) 1134internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1140internal override Exception CheckValueFacets(double value, XmlSchemaDatatype datatype) 1186internal override Exception CheckValueFacets(float value, XmlSchemaDatatype datatype) 1210internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1216internal override Exception CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1281internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1287internal override Exception CheckValueFacets(DateTime value, XmlSchemaDatatype datatype) 1368internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1374internal override Exception CheckValueFacets(string value, XmlSchemaDatatype datatype) 1379internal Exception CheckValueFacets(string value, XmlSchemaDatatype datatype, bool verifyUri) 1385Exception exception; 1454private Exception CheckBuiltInFacets(string s, XmlTypeCode typeCode, bool verifyUri) 1456Exception exception = null; 1510internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1516internal override Exception CheckValueFacets(XmlQualifiedName value, XmlSchemaDatatype datatype) 1579internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1585internal override Exception CheckValueFacets(byte[] value, XmlSchemaDatatype datatype) 1644internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype) 1705internal override Exception CheckValueFacets(object value, XmlSchemaDatatype datatype)
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\XmlSchemaInferenceException.cs (3)
23public XmlSchemaInferenceException(String message) : base(message, ((Exception)null), 0, 0) 27public XmlSchemaInferenceException(String message, Exception innerException) : base(message, innerException, 0, 0) 32public XmlSchemaInferenceException(String message, Exception innerException, int lineNumber, int linePosition) :
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (5)
307Exception innerException = null; 314catch (Exception e) 361catch (Exception eInner) 416catch (Exception eInner) 568Exception exception = tokenDt.TryParseValue(schema.Version, null, null, out version);
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionPreprocessor.cs (4)
247catch (Exception) 326catch (Exception) 1740catch (Exception ex) 1780catch (Exception ex)
FrameworkFork\Microsoft.Xml\Xml\schema\xdrvalidator.cs (1)
356catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaDatatype.cs (2)
117internal abstract Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue); 119internal abstract Exception TryParseValue(object value, XmlNameTable nameTable, IXmlNamespaceResolver namespaceResolver, out object typedValue);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaException.cs (4)
38public XmlSchemaException(String message) : this(message, ((Exception)null), 0, 0) 46public XmlSchemaException(String message, Exception innerException) : this(message, innerException, 0, 0) 51public XmlSchemaException(String message, Exception innerException, int lineNumber, int linePosition) : 88internal XmlSchemaException(string res, string[] args, Exception innerException, string sourceUri, int lineNumber, int linePosition, XmlSchemaObject source) :
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidationException.cs (4)
26public XmlSchemaValidationException(String message) : base(message, ((Exception)null), 0, 0) 31public XmlSchemaValidationException(String message, Exception innerException) : base(message, innerException, 0, 0) 36public XmlSchemaValidationException(String message, Exception innerException, int lineNumber, int linePosition) : 64internal XmlSchemaValidationException(string res, string[] args, Exception innerException, string sourceUri, int lineNumber, int linePosition) :
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (9)
1304Exception exception = s_dtStringArray.TryParseValue(xsiSchemaLocation, _nameTable, _nsResolver, out typedValue); 1455Exception exception = currentElementDecl.Datatype.TryParseValue(currentElementDecl.DefaultValueRaw, _nameTable, _nsResolver, out typedVal); 1497Exception exception = dtype.TryParseValue(parsedValue, _nameTable, _nsResolver, out typedValue); 1664Exception exception = s_dtQName.TryParseValue(xsiType, _nameTable, _nsResolver, out typedVal); 1880catch (Exception e) 1961Exception exception = null; 1998Exception exception = dtype.TryParseValue(stringValue, _nameTable, _nsResolver, out typedValue); 2832private void SendValidationEvent(string code, string[] args, Exception innerException, XmlSeverityType severity) 2840private void SendValidationEvent(string code, string[] args, Exception innerException)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (2)
561protected Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType) 3657private new Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType)
FrameworkFork\Microsoft.Xml\Xml\schema\XsdBuilder.cs (4)
2465catch (Exception) 2477catch (Exception) 2489catch (Exception) 2516catch (Exception)
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (7)
146Exception exception = TryParse(s, durationType, out result); 310Exception exception = TryToTimeSpan(durationType, out result); 318internal Exception TryToTimeSpan(out TimeSpan result) 323internal Exception TryToTimeSpan(DurationType durationType, out TimeSpan result) 325Exception exception = null; 494internal static Exception TryParse(string s, out XsdDuration result) 499internal static Exception TryParse(string s, DurationType durationType, out XsdDuration result)
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (1)
617catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (1)
121internal static Exception NotSupported(string msg)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (3)
172private Exception ReflectionException(string context, Exception e) 653catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (4)
90private Exception _exception; 359internal Exception Exception 790Exception exception = null; 1254private static TypeFlags GetConstructorFlags(Type type, ref Exception exception)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (11)
368private Exception CreateReflectionException(string context, Exception e) 373private Exception CreateTypeReflectionException(string context, Exception e) 378private Exception CreateMemberReflectionException(FieldModel model, Exception e) 467catch (Exception e) 626private static Exception InvalidAttributeUseException(Type type) 631private static Exception UnsupportedException(TypeDesc typeDesc, ImportContext context) 890catch (Exception e) 1301catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemas.cs (1)
797internal static Exception CreateValidationException(XmlSchemaException exception, string message)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (13)
1053catch (Exception e) 1122catch (Exception e) 1363protected Exception CreateUnknownTypeException(XmlQualifiedName type) 1369protected Exception CreateReadOnlyCollectionException(string name) 1375protected Exception CreateAbstractTypeException(string name, string ns) 1381protected Exception CreateInaccessibleConstructorException(string typeName) 1387protected Exception CreateCtorHasSecurityException(string typeName) 1393protected Exception CreateUnknownNodeException() 1399protected Exception CreateUnknownConstantException(string value, Type enumType) 1405protected Exception CreateInvalidCastException(Type type, object value) 1411protected Exception CreateInvalidCastException(Type type, object value, string id) 1422protected Exception CreateBadDerivationException(string xsdDerived, string nsDerived, string xsdBase, string nsBase, string clrDerived, string clrBase) 1428protected Exception CreateMissingIXmlSerializableType(string name, string ns, string clrType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (9)
808protected Exception CreateUnknownTypeException(object o) 814protected Exception CreateUnknownTypeException(Type type) 823protected Exception CreateMismatchChoiceException(string value, string elementName, string enumValue) 830protected Exception CreateUnknownAnyElementException(string name, string ns) 836protected Exception CreateInvalidChoiceIdentifierValueException(string type, string identifier) 842protected Exception CreateChoiceIdentifierValueException(string value, string identifier, string name, string ns) 849protected Exception CreateInvalidEnumValueException(object value, string typeName) 855protected Exception CreateInvalidAnyTypeException(object o) 861protected Exception CreateInvalidAnyTypeException(Type type)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializer.cs (2)
390catch (Exception e) 482catch (Exception e)
FrameworkFork\Microsoft.Xml\Xml\ValidateNames.cs (1)
414internal static Exception GetInvalidNameException(string s, int offsetStartChar, int offsetBadChar)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (44)
377internal static Exception TryVerifyName(string name) 446internal static Exception TryVerifyNCName(string name) 475internal static Exception TryVerifyTOKEN(string token) 518internal static Exception TryVerifyNMTOKEN(string name) 542internal static Exception TryVerifyNormalizedString(string str) 905internal static Exception TryToBoolean(string s, out Boolean result) 939internal static Exception TryToChar(string s, out Char result) 957internal static Exception TryToDecimal(string s, out Decimal result) 971internal static Exception TryToInteger(string s, out Decimal result) 989internal static Exception TryToSByte(string s, out SByte result) 1007internal static Exception TryToInt16(string s, out Int16 result) 1025internal static Exception TryToInt32(string s, out Int32 result) 1043internal static Exception TryToInt64(string s, out Int64 result) 1061internal static Exception TryToByte(string s, out Byte result) 1080internal static Exception TryToUInt16(string s, out UInt16 result) 1100internal static Exception TryToUInt32(string s, out UInt32 result) 1119internal static Exception TryToUInt64(string s, out UInt64 result) 1145internal static Exception TryToSingle(string s, out Single result) 1186internal static Exception TryToDouble(string s, out double result) 1288catch (Exception) 1299internal static Exception TryToTimeSpan(string s, out TimeSpan result) 1302Exception exception; 1464internal static Exception TryToGuid(string s, out Guid result) 1466Exception exception = null; 1535internal static Exception TryToUri(string s, out Uri result) 1758internal static Exception CreateException(string res, ExceptionType exceptionType) 1763internal static Exception CreateException(string res, ExceptionType exceptionType, int lineNo, int linePos) 1775internal static Exception CreateException(string res, string arg, ExceptionType exceptionType) 1780internal static Exception CreateException(string res, string arg, ExceptionType exceptionType, int lineNo, int linePos) 1792internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType) 1797internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType, int lineNo, int linePos) 1809internal static Exception CreateInvalidSurrogatePairException(char low, char hi) 1814internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType) 1819internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType, int lineNo, int linePos) 1828internal static Exception CreateInvalidHighSurrogateCharException(char hi) 1833internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType) 1838internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType, int lineNo, int linePos) 1843internal static Exception CreateInvalidCharException(char[] data, int length, int invCharPos) 1848internal static Exception CreateInvalidCharException(char[] data, int length, int invCharPos, ExceptionType exceptionType) 1853internal static Exception CreateInvalidCharException(string data, int invCharPos) 1858internal static Exception CreateInvalidCharException(string data, int invCharPos, ExceptionType exceptionType) 1863internal static Exception CreateInvalidCharException(char invChar, char nextChar) 1868internal static Exception CreateInvalidCharException(char invChar, char nextChar, ExceptionType exceptionType) 1873internal static Exception CreateInvalidNameCharException(string name, int index, ExceptionType exceptionType)
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (8)
38public XmlException(String message) : this(message, ((Exception)null), 0, 0) 46public XmlException(String message, Exception innerException) : this(message, innerException, 0, 0) 51public XmlException(String message, Exception innerException, int lineNumber, int linePosition) : 56internal XmlException(String message, Exception innerException, int lineNumber, int linePosition, string sourceUri) : 87internal XmlException(string res, String arg, Exception innerException, IXmlLineInfo lineInfo) : 124internal XmlException(string res, string[] args, Exception innerException, int lineNumber, int linePosition) : 128internal XmlException(string res, string[] args, Exception innerException, int lineNumber, int linePosition, string sourceUri) : 265internal static bool IsCatchableException(Exception e)
FrameworkFork\Microsoft.Xml\Xml\XmlXapResolver.cs (1)
29throw new XmlException(ResXml.Xml_XapResolverCannotOpenUri, absoluteUri.ToString(), default(Exception), null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FunctionQuery.cs (1)
86catch (Exception ex)
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathException.cs (5)
26public XPathException() : this(string.Empty, (Exception)null) { } 28public XPathException(string message) : this(message, (Exception)null) { } 30public XPathException(string message, Exception innerException) : 50internal static XPathException Create(string res, string arg, Exception innerException) 60private XPathException(string res, string[] args, Exception inner) :
FrameworkFork\System.Runtime.Serialization\NotImplemented.cs (2)
20internal static Exception ByDesign 28internal static Exception ByDesignWithMessage(String message)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (6)
663catch (Exception ex) 1032catch (Exception ex) 1056catch (Exception ex) 1073catch (Exception ex) 1096catch (Exception ex) 1391catch (Exception ex)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (1)
508catch (Exception ex)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DiagnosticUtility.cs (1)
24internal static bool IsFatal(Exception exception)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DictionaryGlobals.cs (1)
131catch (Exception ex)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (3)
393Dictionary<string, object> exceptionFields = GetExceptionFieldValues((Exception)value); 467private Dictionary<string, object> GetExceptionFieldValues(Exception value) 508if (!(typeof(Exception).IsAssignableFrom(type)))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (1)
106s_typeOfException = typeof(Exception);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\InvalidDataContractException.cs (1)
20public InvalidDataContractException(String message, Exception innerException) : base(message, innerException)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (1)
64catch (Exception ex)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SerializationException.cs (1)
13public SerializationException(string message, Exception innerException)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializer.cs (3)
366internal static Exception CreateSerializationExceptionWithReaderDetails(string errorMessage, XmlReaderDelegator reader) 377static internal SerializationException CreateSerializationException(string errorMessage, Exception innerException) 381internal static string GetTypeInfoError(string errorMessage, Type type, Exception innerException)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
570internal static Exception CreateUnexpectedStateException(XmlNodeType expectedState, XmlReaderDelegator xmlReader) 580internal static Exception CreateSerializationException(string message)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (1)
287private Exception CreateInvalidPrimitiveTypeException(Type type)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XsdDataContractImporter.cs (3)
242catch (Exception ex) 262private void TraceImportError(Exception exception) 280catch (Exception ex)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlExceptionHelper.cs (4)
262static public XmlException CreateConversionException(string type, Exception exception) 267static public XmlException CreateConversionException(string value, string type, Exception exception) 272static public XmlException CreateEncodingException(byte[] buffer, int offset, int count, Exception exception) 277static public XmlException CreateEncodingException(string value, Exception exception)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlUTF8TextReader.cs (1)
609catch (Exception e)
FrameworkFork\System.ServiceModel\ExceptionHelper.cs (3)
14public static Exception AsError(Exception exception) 29public static Exception CreateMaxReceivedMessageSizeExceededException(long maxMessageSize)
FrameworkFork\System.ServiceModel\Framework\System\ComponentModel\InvalidEnumArgumentException.cs (1)
35public InvalidEnumArgumentException(string message, Exception innerException)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AssertHelper.cs (1)
46catch (Exception exception)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AsyncResult.cs (7)
20private Exception _exception; 95protected Action<AsyncResult, Exception> OnCompleting { get; set; } 129catch (Exception exception) 173catch (Exception e) 186protected void Complete(bool completedSynchronously, Exception exception) 216Exception completionException = null; 221catch (Exception e)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\BufferedOutputStream.cs (1)
226protected virtual Exception CreateQuotaExceededException(int maxSizeQuota)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\CallbackException.cs (1)
13public CallbackException(string message, Exception innerException) : base(message, innerException)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\DiagnosticTraceBase.cs (3)
164protected static void AddExceptionToTraceString(XmlWriter xml, Exception exception) 191protected static string StackTraceString(Exception exception) 204protected void LogTraceFailure(string traceString, Exception exception)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\EtwDiagnosticTrace.cs (6)
170public TracePayload GetSerializedPayload(object source, TraceRecord traceRecord, Exception exception) 175public TracePayload GetSerializedPayload(object source, TraceRecord traceRecord, Exception exception, bool getServiceReference) 242internal static string ExceptionToTraceString(Exception exception, int maxTraceStringLength) 265private static void WriteExceptionToTraceString(XmlWriter xml, Exception exception, int remainingLength, int remainingAllowedRecursionDepth) 320private static string GetInnerException(Exception exception, int remainingLength, int remainingAllowedRecursionDepth) 354private static string GetExceptionData(Exception exception)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ExceptionTrace.cs (25)
31public void AsInformation(Exception exception) 36public void AsWarning(Exception exception) 41public Exception AsError(Exception exception) 47return AsError<Exception>(aggregateException); 57return TraceException<Exception>(exception); 60public Exception AsError(Exception exception, string eventSource) 66return AsError<Exception>(aggregateException, eventSource); 76return TraceException<Exception>(exception, eventSource); 79public Exception AsError(TargetInvocationException targetInvocationException, string eventSource) 91Exception innerException = targetInvocationException.InnerException; 99return TraceException<Exception>(targetInvocationException, eventSource); 102public Exception AsError<TPreferredException>(AggregateException aggregateException) 123public Exception AsError<TPreferredException>(AggregateException aggregateException, string eventSource) 136ReadOnlyCollection<Exception> innerExceptions = aggregateException.Flatten().InnerExceptions; 143Exception favoredException = null; 144foreach (Exception nextInnerException in innerExceptions) 149Exception innerException = (targetInvocationException != null && targetInvocationException.InnerException != null) 159TraceException<Exception>(innerException, eventSource); 207public void TraceUnhandledException(Exception exception) 212public void TraceEtwException(Exception exception, EventLevel eventLevel) 217where TException : Exception 226where TException : Exception 241private void BreakOnException(Exception exception)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\FatalException.cs (1)
16public FatalException(string message, Exception innerException) : base(message, innerException)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (12)
118public static Exception AssertAndThrow(string description) 134public static Exception AssertAndThrowFatal(string description) 155public static Exception AssertAndFailFast(string description) 181public static bool IsFatal(Exception exception) 205ReadOnlyCollection<Exception> innerExceptions = ((AggregateException)exception).InnerExceptions; 206foreach (Exception innerException in innerExceptions) 373private static void TraceExceptionNoThrow(Exception exception) 393private static bool HandleAtThreadBase(Exception exception) 409catch (Exception secondException) 440public abstract bool HandleException(Exception exception); 960catch (Exception exception) 993catch (Exception exception)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (9)
324public void EnqueueAndDispatch(Exception exception, Action dequeuedCallback, bool canDispatchOnThisThread) 342public bool EnqueueWithoutDispatch(Exception exception, Action dequeuedCallback) 356public void Shutdown(Func<Exception> pendingExceptionGenerator) 385Exception exception = (pendingExceptionGenerator != null) ? pendingExceptionGenerator() : null; 748private Exception _exception; 756public Item(Exception exception, Action dequeuedCallback) 761private Item(T value, Exception exception, Action dequeuedCallback) 773public Exception Exception 1004private Exception _exception;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ScheduleActionItemAsyncResult.cs (2)
27Exception completionException = null; 32catch (Exception ex)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (2)
206public static void Wait(this Task task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType) 221catch (Exception ex)
FrameworkFork\System.ServiceModel\Internals\TraceCore.Designer.cs (10)
75internal static void HandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception) 111internal static void ThrowingException(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception) 134internal static void UnhandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception) 262internal static void HandledExceptionWarning(EtwDiagnosticTrace trace, string param0, System.Exception exception) 370internal static void HandledExceptionError(EtwDiagnosticTrace trace, string param0, System.Exception exception) 393internal static void HandledExceptionVerbose(EtwDiagnosticTrace trace, string param0, System.Exception exception) 416internal static void EtwUnhandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception) 440internal static void ThrowingEtwException(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception) 464internal static void ThrowingEtwExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception) 488internal static void ThrowingExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
FrameworkFork\System.ServiceModel\SMDiagnostics\System\ServiceModel\Diagnostics\ExceptionUtility.cs (19)
64public Exception ThrowHelperFatal(string message, Exception innerException) 69public Exception ThrowHelperInternal(bool fatal) 74public Exception ThrowHelperInvalidOperation(string message) 79public Exception ThrowHelperCallback(string message, Exception innerException) 84public Exception ThrowHelperCallback(Exception innerException) 89public Exception ThrowHelperCritical(Exception exception) 94public Exception ThrowHelperError(Exception exception) 99public Exception ThrowHelperWarning(Exception exception) 104internal Exception ThrowHelper(Exception exception, EventLevel eventLevel) 111internal Exception ThrowHelperXml(XmlReader reader, string message) 116internal Exception ThrowHelperXml(XmlReader reader, string message, Exception inner)
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
389private static Exception s_initializationException; 479catch (Exception ex)
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityMessageSerializationException.cs (1)
19public SecurityMessageSerializationException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\KeyInfoSerializer.cs (4)
210catch (Exception e) 259catch (Exception e) 300catch (Exception e) 331private bool ShouldWrapException(Exception e)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityTokenException.cs (1)
19public SecurityTokenException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityTokenValidationException.cs (1)
19public SecurityTokenValidationException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\IdentityModel\XmlBuffer.cs (1)
51private Exception CreateInvalidStateException()
FrameworkFork\System.ServiceModel\System\ServiceModel\ActionNotSupportedException.cs (1)
14public ActionNotSupportedException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (6)
474Exception inner = new QuotaExceededException(message); 1610Exception ex = null; 1615catch (Exception e) 1628catch (Exception e) 1647catch (Exception e) 1668catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedConnection.cs (3)
17private Exception _pendingWriteException; 79catch (Exception e) 258Exception exceptionTothrow = _pendingWriteException;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (3)
251private void WriteToBuffer(byte[] array, ref int offset, ref int count, out Exception error) 258catch (Exception ex) 424Exception error;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferManagerOutputStream.cs (1)
41protected override Exception CreateQuotaExceededException(int maxSizeQuota)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChainedAsyncResult.cs (4)
59Exception completeException = null; 66catch (Exception exception) 102Exception completeException = null; 109catch (Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelManagerBase.cs (1)
46internal Exception CreateChannelTypeNotSupportedException(Type type)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelRequirements.cs (5)
224public static Exception CantCreateListenerException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels, string bindingName) 229Exception exception = ChannelRequirements.BindingContractMismatchException(supportedChannels, requiredChannels, bindingName, 242public static Exception CantCreateChannelException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels, string bindingName) 247Exception exception = ChannelRequirements.BindingContractMismatchException(supportedChannels, requiredChannels, bindingName, 259public static Exception BindingContractMismatchException(IEnumerable<Type> supportedChannels, IEnumerable<Type> requiredChannels,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (1)
217catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CloseCollectionAsyncResult.cs (5)
14private Exception _exception; 40catch (Exception e) 61Exception closeException = null; 67catch (Exception e) 105private void Decrement(bool completedSynchronously, Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObject.cs (11)
219private Exception CreateNotOpenException() 224private Exception CreateImmutableException() 229private Exception CreateBaseClassMethodNotCalledException(string method) 234internal Exception CreateClosedException() 246internal Exception CreateFaultedException() 252internal Exception CreateAbortedException() 386catch (Exception exception) 415catch (Exception exception) 441catch (Exception exception) 470catch (Exception exception) 492catch (Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (3)
367catch (Exception e) 415catch (Exception e) 516private Exception ConvertIOException(IOException ioException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionPool.cs (1)
517catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (8)
144catch (Exception e) 355Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Undefined); 407Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Write); 466catch (Exception exception) 550Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Write); 593Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Read); 668Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Read); 706catch (Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FaultConverter.cs (10)
16protected abstract bool OnTryCreateException(Message message, MessageFault fault, out Exception exception); 17protected abstract bool OnTryCreateFaultMessage(Exception exception, out Message message); 19public bool TryCreateException(Message message, MessageFault fault, out Exception exception) 37Exception error = new InvalidOperationException(text); 46Exception error = new InvalidOperationException(text, exception); 54public bool TryCreateFaultMessage(Exception exception, out Message message) 63Exception error = new InvalidOperationException(text); 72Exception error = new InvalidOperationException(text); 89protected override bool OnTryCreateException(Message message, MessageFault fault, out Exception exception) 197protected override bool OnTryCreateFaultMessage(Exception exception, out Message message)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingDecoders.cs (19)
131Exception quotaExceeded = OnSizeQuotaExceeded(_encodedSize); 189protected abstract Exception OnSizeQuotaExceeded(int size); 214protected override Exception OnSizeQuotaExceeded(int size) 216Exception result = new InvalidDataException(string.Format(SRServiceModel.FramingViaTooLong, size)); 254protected override Exception OnSizeQuotaExceeded(int size) 259public static Exception GetFaultException(string faultString, string via, string contentType) 283Exception inner = new QuotaExceededException(SRServiceModel.FramingMaxMessageSizeExceeded); 296Exception inner = new QuotaExceededException(string.Format(SRServiceModel.FramingContentTypeTooLongFault, contentType)); 301Exception inner = new QuotaExceededException(string.Format(SRServiceModel.FramingViaTooLongFault, via)); 326protected override Exception OnSizeQuotaExceeded(int size) 328Exception result = new InvalidDataException(string.Format(SRServiceModel.FramingContentTypeTooLong, size)); 393Exception exception = CreateException(new InvalidDataException(string.Format( 413Exception inner = CreateInvalidRecordTypeException(FramingRecordType.PreambleAck, foundType); 427private Exception CreateInvalidRecordTypeException(FramingRecordType expectedType, FramingRecordType foundType) 436Exception exception = CreateException(new InvalidDataException(string.Format( 442public Exception CreatePrematureEOFException() 447protected Exception CreateException(InvalidDataException innerException, string framingFault) 449Exception result = CreateException(innerException); 454protected Exception CreateException(InvalidDataException innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingFormat.cs (2)
154public static bool TryGetFaultString(Exception exception, out string framingFault) 169public static void AddFaultString(Exception exception, string framingFault)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (2)
351internal Exception CreateToMustEqualViaException(Uri to, Uri via) 1165catch (Exception addHeaderException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelHelpers.cs (5)
114var inner = requestException.InnerException; 126public static Exception ConvertHttpRequestException(HttpRequestException exception, HttpRequestMessage request, HttpAbortReason abortReason) 147internal static Exception CreateUnexpectedResponseException(HttpResponseMessage response) 174internal static Exception TraceResponseException(Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (4)
59var exception = ProcessHttpAddressing(message); 65private Exception ProcessHttpAddressing(Message message) 67Exception result = null; 254Exception inner = new QuotaExceededException(message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpsChannelFactory.cs (1)
200catch (Exception ex)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IdlingCommunicationPool.cs (3)
109private Exception _pendingException; 224catch (Exception e) 320Exception exceptionToThrow = _pendingException;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\InvalidChannelBindingException.cs (1)
13public InvalidChannelBindingException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MaxMessageSizeStream.cs (4)
64public static Exception CreateMaxReceivedMessageSizeExceededException(long maxMessageSize) 67Exception inner = new QuotaExceededException(message); 77internal static Exception CreateMaxSentMessageSizeExceededException(long maxMessageSize) 80Exception inner = new QuotaExceededException(message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (16)
222internal Exception CreateMessageDisposedException() 1028Exception ex = null; 1033catch (Exception e) 1045catch (Exception e) 1250Exception versionMismatchException = new ArgumentException(string.Format(SRServiceModel.EncoderEnvelopeVersionMismatch, envelopeVersion, desiredVersion.Envelope), "reader"); 1319Exception ex = null; 1324catch (Exception e) 1335catch (Exception e) 1350catch (Exception e) 1452Exception versionMismatchException = new ArgumentException(string.Format(SRServiceModel.EncoderEnvelopeVersionMismatch, envelopeVersion, desiredVersion.Envelope), "reader"); 1605Exception ex = null; 1610catch (Exception e) 1621catch (Exception e) 1636catch (Exception e) 1653catch (Exception e) 1833Exception inner = new QuotaExceededException(message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageBuffer.cs (1)
44internal Exception CreateBufferDisposedException()
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeader.cs (1)
271throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(exception.Message, (Exception)null));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeaders.cs (1)
556private Exception CreateDuplicateHeaderException(HeaderKind kind)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\OpenCollectionAsyncResult.cs (3)
14private Exception _exception; 58catch (Exception e) 80private void Decrement(bool completedSynchronously, Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ReliableSessionBindingElementImporter.cs (1)
250Exception innerException = null;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestContextBase.cs (2)
19private Exception _requestMessageException; 61protected void SetRequestMessage(Exception requestMessageException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityChannelFaultConverter.cs (2)
16protected override bool OnTryCreateException(Message message, MessageFault fault, out Exception exception) 36protected override bool OnTryCreateFaultMessage(Exception exception, out Message message)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (18)
596Exception error = new InvalidOperationException(text); 604Exception error = new InvalidOperationException(text); 933Exception error = new ProtocolException(string.Format(SRServiceModel.SFxReplyActionMismatch3, 1001Exception exception; 1085Exception error = new CommunicationObjectAbortedException(text); 1105Exception error = new InvalidOperationException(text); 1124Exception error = new InvalidOperationException(text); 1705Exception exception = null; 1711catch (Exception e) 1734Exception exception = null; 1740catch (Exception e) 1769Exception exception = null; 1776catch (Exception e) 1800Exception exception = null; 1815catch (Exception e) 1853Exception exception = null; 1872catch (Exception e) 1889private void CallComplete(bool completedSynchronously, Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (6)
183catch (Exception e) 201catch (Exception e) 225catch (Exception e) 243catch (Exception e) 270public bool TrySetException(Exception exception) 292TrySetExceptionMethod = GenericType.GetRuntimeMethod("TrySetException", new Type[] { typeof(Exception) });
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (2)
25private Exception _pendingException; 227Exception exception = _pendingException;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (13)
32protected Exception _asyncReadException; 38protected Exception _asyncWriteException; 170protected Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime) 176protected Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime) 182internal static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException) 188protected Exception ConvertObjectDisposedException(ObjectDisposedException originalException, TransferOperation transferOperation) 204private static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, 259private static Exception ConvertTimeoutErrorException(Exception originalException, 435public static Exception ConvertConnectException(SocketException socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (13)
113internal static void ThrowCorrectException(Exception ex) 120internal static void ThrowCorrectException(Exception ex, TimeSpan timeout, string operation) 125internal static Exception ConvertAndTraceException(Exception ex) 135internal static Exception ConvertAndTraceException(Exception ex, TimeSpan timeout, string operation) 148Exception exception = FxTrace.Exception.AsError<OperationCanceledException>(aggregationException); 158Exception communicationException = ConvertAggregateExceptionToCommunicationException(aggregationException); 176internal static Exception ConvertAggregateExceptionToCommunicationException(AggregateException ex) 178Exception exception = FxTrace.Exception.AsError<Exception>(ex); 202internal static Exception CreateExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 215internal static TimeoutException GetTimeoutException(Exception innerException, TimeSpan timeout, string operation)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (19)
28private Exception _pendingWritingMessageException; 142catch (Exception ex) 310catch (Exception ex) 346private static void ThrowOnPendingException(ref Exception pendingException) 348Exception exceptionToThrow = pendingException; 363catch (Exception e) 380catch (Exception e) 402catch (Exception) 418catch (Exception) 449catch (Exception ex) 464private Exception _pendingException; 637catch (Exception ex) 690internal void FinishUsingMessageStream(Exception ex) 785catch (Exception ex) 1062catch (Exception ex) 1142catch (Exception ex) 1216catch (Exception ex) 1261Exception pendingException = null; 1281catch (Exception ex)
FrameworkFork\System.ServiceModel\System\ServiceModel\ChannelTerminatedException.cs (1)
11public ChannelTerminatedException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\ClientBase.cs (6)
383internal InvokeAsyncCompletedEventArgs(object[] results, Exception error, bool cancelled, object userState) 415Exception error = null; 426catch (Exception e) 449Exception error = null; 455catch (Exception e) 468private static void CompleteAsyncCall(AsyncOperationContext context, object[] results, Exception error)
FrameworkFork\System.ServiceModel\System\ServiceModel\CommunicationException.cs (1)
11public CommunicationException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\CommunicationObjectAbortedException.cs (1)
11public CommunicationObjectAbortedException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\CommunicationObjectFaultedException.cs (1)
11public CommunicationObjectFaultedException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (1)
39private static Type s_exceptionType = typeof(Exception);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\DispatcherBuilder.cs (1)
309Exception error = new InvalidOperationException(text);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (1)
1680internal static bool TryGetFailedReferenceType(Exception ex, out Type failedReferenceType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (17)
632catch (Exception e) 752catch (Exception e) 800catch (Exception e) 812catch (Exception e) 829catch (Exception e) 880Exception exception = null; 886catch (Exception e) 960catch (Exception e) 974catch (Exception e) 1013catch (Exception e) 1063catch (Exception e) 1112Exception exception = null; 1118catch (Exception e) 1166Exception exception = null; 1173catch (Exception e) 1235Exception exception = null; 1242catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExporter.cs (3)
62catch (Exception e) 144private Exception CreateExtensionException(IPolicyExportExtension exporter, Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataImporter.cs (3)
101catch (Exception e) 139private Exception CreateExtensionException(IPolicyImportExtension importer, Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
474catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (6)
1177catch (Exception e) 1192catch (Exception e) 1200private Exception ThrowExtensionException(ContractDescription contract, IWsdlExportExtension exporter, Exception e) 1208private Exception ThrowExtensionException(ServiceEndpoint endpoint, IWsdlExportExtension exporter, Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (20)
342catch (Exception e) 408catch (Exception e) 423catch (Exception e) 480catch (Exception e) 565catch (Exception e) 620catch (Exception e) 671catch (Exception e) 691catch (Exception e) 707catch (Exception e) 1894private static Exception CreateBeforeImportExtensionException(IWsdlImportExtension importer, Exception e) 1900private Exception CreateAlreadyFaultedException(WsdlNS.NamedItem item) 1907private static Exception CreateExtensionException(IWsdlImportExtension importer, Exception e) 1926private WsdlImportException(WsdlNS.NamedItem item, Exception innerException) 1933internal static WsdlImportException Create(WsdlNS.NamedItem item, Exception innerException) 1964Exception messageException = this.InnerException; 2236catch (Exception e) 2255catch (Exception e) 2271catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\ActivityIdHeader.cs (2)
54catch (Exception e) 93catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\TraceUtility.cs (9)
37catch (Exception e) 54catch (Exception e) 234internal static Exception ThrowHelperError(Exception exception, Message message) 239internal static Exception ThrowHelperError(Exception exception, Guid activityId, object source) 244internal static Exception ThrowHelperWarning(Exception exception, Message message) 268internal static void TraceUserCodeException(Exception e, MethodInfo method)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\BufferedReceiveBinder.cs (2)
198catch (Exception exception) 240catch (Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelDispatcher.cs (6)
304internal bool HandleError(Exception error) 310internal bool HandleError(Exception error, ref ErrorHandlerFaultInfo faultInfo) 346catch (Exception e) 614internal void ProvideFault(Exception e, FaultConverter faultConverter, ref ErrorHandlerFaultInfo faultInfo) 643Exception error = new InvalidOperationException(SRServiceModel.SFxChannelDispatcherNoMessageVersion); 685Exception error = new InvalidOperationException(SRServiceModel.SFxCollectionDoesNotSupportSet0);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelHandler.cs (23)
305catch (Exception e) 498private void ProvideFault(Exception e, ref ErrorHandlerFaultInfo faultInfo) 511internal bool HandleError(Exception e) 517private bool HandleError(Exception e, ref ErrorHandlerFaultInfo faultInfo) 538private bool HandleError(Exception e, RequestContext request, ServiceChannel channel) 554private bool HandleErrorContinuation(Exception e, RequestContext request, ServiceChannel channel, ref ErrorHandlerFaultInfo faultInfo, bool replied) 562catch (Exception e1) 586catch (Exception e2) 598catch (Exception e3) 621catch (Exception e4) 769Exception exception = null; 774catch (Exception e) 876private void ProvideFaultAndReplyFailure(RequestContext request, Exception exception, ref ErrorHandlerFaultInfo faultInfo, out bool replied, out bool replySentAsync) 886catch (Exception e) 947catch (Exception e) 983catch (Exception e) 1032catch (Exception e) 1046catch (Exception e) 1060catch (Exception e) 1085catch (Exception e) 1167catch (Exception e) 1202catch (Exception e) 1293public Exception Exception;
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ConcurrencyBehavior.cs (1)
197catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DispatchRuntime.cs (1)
394catch (Exception ex)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (14)
704Exception completionException = null; 711catch (Exception exception) 806private Exception _sendException; 924Exception sendException = null; 931catch (Exception e) 1156Exception exceptionFromBeginReceive = null; 1161catch (Exception e) 1207Exception receiveException = null; 1212catch (Exception e) 1252Exception backgroundCloseException = null; 1261catch (Exception e) 1296Exception backgroundCloseException = null; 1301catch (Exception e) 1569public void CaptureBackgroundException(Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\EndpointDispatcher.cs (2)
98Exception error = new InvalidOperationException(SRServiceModel.SFxEndpointDispatcherMultipleChannelDispatcher0); 115Exception error = new InvalidOperationException(SRServiceModel.SFxEndpointDispatcherDifferentChannelDispatcher0);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ErrorBehavior.cs (12)
28Exception error = rpc.Error; 79private void ProvideFaultOfLastResort(Exception error, ref ErrorHandlerFaultInfo faultInfo) 113internal void ProvideFault(Exception e, FaultConverter faultConverter, ref ErrorHandlerFaultInfo faultInfo) 129private void ProvideWellKnownFault(Exception e, FaultConverter faultConverter, ref ErrorHandlerFaultInfo faultInfo) 169private bool HandleErrorCommon(Exception error, ref ErrorHandlerFaultInfo faultInfo) 198catch (Exception e) 209internal bool HandleError(Exception error) 215internal bool HandleError(Exception error, ref ErrorHandlerFaultInfo faultInfo) 220internal static bool ShouldRethrowClientSideExceptionAsIs(Exception e) 227internal static void ThrowAndCatch(Exception e, Message message) 254catch (Exception e2) 263internal static void ThrowAndCatch(Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ErrorHandlingReceiver.cs (6)
27catch (Exception e) 37private void HandleError(Exception e) 45private void HandleErrorOrAbort(Exception e) 84catch (Exception e) 120catch (Exception e) 167catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\IErrorHandler.cs (2)
11void ProvideFault(Exception error, MessageVersion version, ref Message fault); 12bool HandleError(Exception error);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ImmutableClientRuntime.cs (10)
101catch (Exception e) 130catch (Exception e) 168catch (Exception e) 216catch (Exception e) 264Exception exception = null; 274catch (Exception e) 312Exception exception = null; 325private void CallEnd(IAsyncResult result, out Exception exception) 332catch (Exception e) 343private void CallComplete(bool completedSynchronously, Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ImmutableDispatchRuntime.cs (16)
138catch (Exception e) 178catch (Exception e) 222catch (Exception e) 303Exception exception = null; 314catch (Exception e) 346catch (Exception e) 509catch (Exception e) 578catch (Exception e) 609catch (Exception e) 642catch (Exception e) 722catch (Exception e) 766catch (Exception e) 784catch (Exception e) 798catch (Exception e) 815catch (Exception e) 835catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InstanceBehavior.cs (1)
40catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InvalidBodyAccessException.cs (1)
14protected InvalidBodyAccessException(string message, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ListenerHandler.cs (6)
183catch (Exception e) 210catch (Exception e) 234catch (Exception e) 258catch (Exception e) 312catch (Exception e) 420private bool HandleError(Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\MessageRpc.cs (13)
35internal Exception Error; 171catch (Exception e) 217catch (Exception e) 236catch (Exception e) 255catch (Exception e) 274catch (Exception e) 293private bool ProcessError(Exception e) 322catch (Exception e2) 359catch (Exception e) 386catch (Exception e) 451catch (Exception e) 481catch (Exception e) 594Exception error = new InvalidOperationException(text);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\NetDispatcherFaultException.cs (2)
9public NetDispatcherFaultException(string reason, FaultCode code, Exception innerException) 13public NetDispatcherFaultException(FaultReason reason, FaultCode code, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\OperationFormatter.cs (1)
552internal static NetDispatcherFaultException CreateDeserializationFailedFault(string reason, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (2)
184catch (Exception e) 222catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\StreamFormatter.cs (1)
284catch (Exception ex)
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (1)
977return new XmlException(message, (Exception)null, lineInfo.LineNumber, lineInfo.LinePosition);
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointNotFoundException.cs (1)
11public EndpointNotFoundException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\ExceptionDetail.cs (1)
20public ExceptionDetail(Exception exception)
FrameworkFork\System.ServiceModel\System\ServiceModel\FaultException.cs (2)
69internal FaultException(string reason, FaultCode code, string action, Exception innerException) 85internal FaultException(FaultReason reason, FaultCode code, string action, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\InstanceContext.cs (1)
198Exception error = new InvalidOperationException(SRServiceModel.SFxInstanceNotInitialized);
FrameworkFork\System.ServiceModel\System\ServiceModel\InvalidMessageContractException.cs (1)
22public InvalidMessageContractException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\MessageHeaderException.cs (3)
24public MessageHeaderException(string message, Exception innerException) 36public MessageHeaderException(string message, string headerName, string ns, Exception innerException) 40public MessageHeaderException(string message, string headerName, string ns, bool isDuplicate, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\OperationContext.cs (1)
301catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\ProtocolException.cs (1)
14public ProtocolException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\QuotaExceededException.cs (1)
22public QuotaExceededException(string message, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\EncryptedKey.cs (2)
244catch (Exception e) 273private SecurityKeyIdentifier ReadGenericXmlSecurityKeyIdentifier(XmlDictionaryReader localReader, Exception previousException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\IdentityVerifier.cs (3)
81Exception e = CreateIdentityCheckException(identity, authorizationContext, errorString, serviceReference); 87private Exception CreateIdentityCheckException(EndpointIdentity identity, AuthorizationContext authorizationContext, string errorString, EndpointAddress serviceReference) 89Exception result;
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\MessageSecurityException.cs (2)
24public MessageSecurityException(String message, Exception innerException) 29internal MessageSecurityException(string message, Exception innerException, MessageFault fault)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityAccessDeniedException.cs (1)
14public SecurityAccessDeniedException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityNegotiationException.cs (1)
19public SecurityNegotiationException(String message, Exception innerException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityProtocolFactory.cs (4)
889catch (Exception e) 907catch (Exception e) 925catch (Exception e) 943catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (4)
630catch (Exception e) 934private static Exception CreateCertificateLoadException(StoreName storeName, StoreLocation storeLocation, 1073Exception completionException = null; 1082catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\TimeBoundedCache.cs (1)
411Exception inner = new QuotaExceededException(message);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityPolicy.cs (5)
1939catch (Exception e) 2357catch (Exception e) 2879Exception mexException = null; 2884catch (Exception e) 2903catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityPolicy11.cs (1)
89catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityTokenSerializer.cs (3)
200private bool ShouldWrapException(Exception e) 234catch (Exception e) 427catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSTrust.cs (1)
555catch (Exception e)
FrameworkFork\System.ServiceModel\System\ServiceModel\ServerTooBusyException.cs (1)
14public ServerTooBusyException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceActivationException.cs (1)
14public ServiceActivationException(string message, Exception innerException) : base(message, innerException) { }
FrameworkFork\System.ServiceModel\System\ServiceModel\XmlBuffer.cs (1)
125private Exception CreateInvalidStateException()
FrameworkFork\System.Web.Services\Fx.cs (1)
9internal static bool IsFatal(Exception e)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (1)
3185catch (Exception e)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptions.cs (1)
107private Exception ItemNotFound(XmlQualifiedName name, string type)
FrameworkFork\System.Web.Services\Services\Description\WebReferenceOptions.cs (1)
165catch (Exception e)
ImportModule.cs (5)
60catch (Exception e) 89catch (Exception e) 117catch (Exception e) 149catch (Exception e) 216catch (Exception e)
MarkupTelemetryHelper.cs (1)
118public static void TelemetryPostFault(Exception ex)
Metadata\HttpAuthenticationHelper.cs (1)
20public static T GetException<T>(Exception exception) where T : class
Metadata\MetadaExchangeResolver.cs (4)
37private Exception _metadataException; 199catch (Exception ex) 277catch (Exception ex) 299private bool RequiresAuthentication(Exception exception, Uri serviceUri, out bool isAuthenticationError)
Metadata\MetadataDocumentLoader.cs (4)
69private readonly List<Exception> _documentLoadExceptions = new List<Exception>(); 70public IEnumerable<Exception> DocumentLoadExceptions { get { return _documentLoadExceptions; } } 400catch (Exception ex)
Metadata\MetadataExchangeException.cs (1)
18public MetadataExchangeException(string message, Exception innerException) : base(message, innerException) { }
Metadata\ServiceDescriptor.cs (1)
71public IEnumerable<Exception> DocumentLoadExceptions { get { return this.metadataDocumentLoader.DocumentLoadExceptions; } }
OutputPathHelper.cs (2)
77catch (Exception e) 101catch (Exception e)
Shared\MSBuildProj.cs (2)
848catch (Exception ex) 929catch (Exception ex)
Shared\Options\ApplicationOptions.cs (5)
29private List<Exception> _errors { get; set; } = new List<Exception>(); 30public IEnumerable<Exception> Errors { get { return this._errors; } } 146catch (Exception ex) 292public void AddError(Exception ex)
Shared\Options\OptionsSerializer.cs (2)
85catch (Exception ex) 117catch (Exception ex)
Shared\Options\OptionValueParser.cs (2)
253catch (Exception ex) 275public static void ThrowInvalidValue(object value, OptionBase option, Exception innerException)
Shared\ProjectPropertyResolver.cs (2)
68catch (Exception ex) 95catch (Exception ex)
Shared\Utilities\PathHelper.cs (2)
219catch (Exception ex) 267catch (Exception ex)
Shared\Utilities\RuntimeEnvironmentHelper.cs (1)
116catch (Exception ex)
Shared\Utilities\Utilities.cs (4)
12internal static bool IsUnexpected(Exception ex) 17internal static bool IsFatal(Exception ex) 29internal static bool IsFatalOrUnexpected(Exception ex) 34internal static string GetExceptionMessage(Exception e, bool includeStackTrace = false)
Tool.cs (4)
166catch (Exception e) 232catch (Exception ex) 330private static async Task<int> ProcessExceptionAsync(Exception ex, CommandProcessorOptions options) 346foreach (var ax in agex.InnerExceptions)
ToolArgumentException.cs (1)
28internal ToolArgumentException(String message, Exception innerException) : base(message, innerException)
ToolConsole.cs (3)
38internal static void WriteToolError(Exception ex) 65internal static void WriteError(Exception e) 70internal static void WriteError(Exception e, string prefix)
ToolInputException.cs (1)
30internal ToolInputException(String message, Exception innerException) : base(message, innerException)
ToolRuntimeException.cs (1)
21public ToolRuntimeException(String message, Exception innerException) : base(message, innerException)
TypeLoader.cs (2)
31catch (Exception ex) 59foreach (var ex in rtle.LoaderExceptions)
dotnet-user-jwts (2)
Program.cs (1)
62catch (Exception ex)
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
39catch (Exception ex)
dotnet-user-secrets (2)
Program.cs (1)
40catch (Exception exception)
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (1)
39catch (Exception ex)
ExceptionHandlerSample (1)
StartupWithWebSocket.cs (1)
41catch (Exception ex)
Extensibility.MessageInterceptor.IntegrationTests (12)
AsyncResult.cs (2)
20private Exception _exception; 125protected void Complete(bool completedSynchronously, Exception exception)
ChainedAsyncResult.cs (4)
57Exception completeException = null; 63catch (Exception exception) 96Exception completeException = null; 102catch (Exception exception)
InterceptingChannelFactory.cs (4)
208Exception completionException = null; 214catch (Exception e) 329Exception completionException = null; 335catch (Exception e)
InterceptingDuplexChannel.cs (2)
177Exception completeException = null; 182catch (Exception e)
GetDocument.Insider (11)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (7)
66Action<Exception?>? entrypointCompleted = null) 206private readonly Action<Exception?>? _entrypointCompleted; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted) 227Exception? exception = null; 260catch (Exception ex) 304public void OnError(Exception error) 356throw (Exception)Activator.CreateInstance(publicHostAbortedExceptionType)!;
CommandException.cs (1)
15public CommandException(string message, Exception innerException)
Commands\GetDocumentCommand.cs (1)
152catch (Exception ex)
Commands\GetDocumentCommandWorker.cs (1)
181catch (Exception ex)
ProgramBase.cs (1)
54catch (Exception ex)
HelixTestRunner (8)
Program.cs (1)
62catch (Exception e)
TestRunner.cs (7)
74catch (Exception e) 97catch (Exception e) 114catch (Exception e) 158catch (Exception e) 189catch (Exception e) 216catch (Exception e) 280catch (Exception e)
HotAddSample (1)
Startup.cs (1)
49catch (Exception ex)
http2cat (7)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
HttpStress (2)
Program.cs (2)
128catch (Exception e) 593catch (Exception e)
IIS.FunctionalTests (18)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (3)
155List<Exception> exceptions = null; 168catch (Exception e) 173exceptions = new List<Exception>(retries);
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
104catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
src\Shared\TransportTestHelpers\HttpSysHttp3SupportedAttribute.cs (1)
33catch (Exception)
IIS.LongTests (13)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
IIS.NewHandler.FunctionalTests (13)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
IIS.NewShim.FunctionalTests (13)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
IIS.ShadowCopy.Tests (8)
ShadowCopyTests.cs (1)
386catch (Exception e)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
IIS.Tests (21)
ClientDisconnectTests.cs (11)
64Exception exception = null; 78catch (Exception e) 107Exception exception = null; 117catch (Exception e) 146Exception exception = null; 160catch (Exception e) 188Exception exception = null; 200catch (Exception e) 220catch (Exception) 235Exception exception = null; 245catch (Exception e)
HttpBodyControlFeatureTests.cs (4)
20Exception writeException = null; 21Exception readException = null; 32catch (Exception ex) 41catch (Exception ex)
ResponseAbortTests.cs (4)
69Exception exception = null; 80catch (Exception e) 99Exception exception = null; 109catch (Exception e)
Utilities\TestServer.cs (2)
212var exceptions = new List<Exception>(); 221catch (Exception e)
IISExpress.FunctionalTests (17)
src\Servers\IIS\IIS\test\Common.FunctionalTests\AspNetCorePortTests.cs (3)
155List<Exception> exceptions = null; 168catch (Exception e) 173exceptions = new List<Exception>(retries);
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
104catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
26catch (Exception)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (3)
138var exceptions = new List<Exception>(); 147catch (Exception e) 236catch (Exception ex)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (2)
166public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
illink (10)
ILLink.Tasks (1)
Utils.cs (1)
19 } catch (Exception) {
Infrastructure.Common (5)
ServiceUtilHelper.cs (4)
129catch (Exception ex) 218catch (Exception ex) 272catch (Exception ex) 331catch (Exception ex)
xunit\ConditionAttribute.cs (1)
87catch (Exception exc)
InMemory.FunctionalTests (139)
BadHttpRequestTests.cs (1)
311public void OnError(Exception error) { }
ChunkedRequestTests.cs (1)
876catch (Exception ex)
ConnectionLimitTests.cs (1)
211catch (Exception ex)
EventSourceTests.cs (1)
302await Assert.ThrowsAnyAsync<Exception>(() => sslStream.AuthenticateAsClientAsync(clientAuthOptions, handshakeCts.Token));
Http2\Http2ConnectionTests.cs (10)
1935catch (Exception ex) 2011catch (Exception ex) 3244catch (Exception ex) 3354catch (Exception ex) 4267catch (Exception ex) 4361catch (Exception ex) 4617catch (Exception ex) 5338var exception = new Exception(); 5936catch (Exception ex) 5992catch (Exception ex)
Http2\Http2EndToEndTests.cs (2)
126public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Http2\Http2StreamTests.cs (23)
40await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, 1, Http2ErrorCode.PROTOCOL_ERROR, "Malformed request: invalid headers."); 2235await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 2586await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 3268catch (Exception ex) 3311catch (Exception ex) 3353catch (Exception ex) 3395catch (Exception ex) 4304catch (Exception e) 4695var expectedException = new Exception(); 4754catch (Exception ex) 4810catch (Exception ex) 4876catch (Exception ex) 4932catch (Exception ex) 4997catch (Exception ex) 5056catch (Exception ex) 5174catch (Exception ex) 5248catch (Exception ex) 5324catch (Exception ex) 5395catch (Exception ex) 5467catch (Exception ex) 5552catch (Exception ex) 5633catch (Exception ex) 5720catch (Exception ex)
Http2\Http2TestBase.cs (3)
1287return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR, expectedErrorMessage: null); 1301where TException : Exception 1308where TException : Exception
Http2\PipeReaderFactory.cs (1)
43catch (Exception ex)
Http3\Http3ConnectionTests.cs (2)
624catch (Exception ex) 678catch (Exception ex)
Http3\Http3StreamTests.cs (17)
773catch (Exception ex) 1150catch (Exception ex) 1199catch (Exception ex) 1251catch (Exception ex) 1300catch (Exception ex) 1352catch (Exception ex) 1404catch (Exception ex) 1501catch (Exception ex) 1556catch (Exception ex) 1613catch (Exception ex) 1671catch (Exception ex) 1730catch (Exception ex) 1794catch (Exception ex) 1855catch (Exception ex) 1923catch (Exception ex) 2065catch (Exception ex) 2841catch (Exception ex)
Http3\WebTransport\WebTransportTestUtilities.cs (2)
148public Task CompleteAsync(Exception exception) 185public override void Complete(Exception exception = null)
HttpProtocolSelectionTests.cs (1)
78where TException : Exception
HttpsConnectionMiddlewareTests.cs (3)
217await Assert.ThrowsAnyAsync<Exception>( 1154var ex = await Assert.ThrowsAnyAsync<Exception>(
HttpsTests.cs (11)
94var ex = await Assert.ThrowsAnyAsync<Exception>(() => 103var errorException = Assert.Single(loggerProvider.ErrorLogger.ErrorExceptions); 287catch (Exception ex) 697await Assert.ThrowsAnyAsync<Exception>(() => 824public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 848public List<Exception> ErrorExceptions { get; } = new List<Exception>(); 852public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
KestrelMetricsTests.cs (2)
820await Assert.ThrowsAnyAsync<Exception>(() => stream.ReadUntilEndAsync()).DefaultTimeout(); 979catch (Exception ex)
RequestBodyTimeoutTests.cs (1)
179catch (Exception ex)
RequestTests.cs (1)
127catch (Exception ex)
ResponseTests.cs (13)
176catch (Exception ex) 228catch (Exception ex) 686catch (Exception ex) 724catch (Exception ex) 764catch (Exception ex) 802catch (Exception ex) 844catch (Exception ex) 2479var onStartingException = new Exception(); 3080var expectedException = new Exception(); 3108var expectedException = new Exception(); 4113var expectedException = new Exception(); 4596catch (Exception ex) 4652catch (Exception ex)
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
15public Exception? CompleteException { get; private set; } 33public override ValueTask CompleteAsync(Exception? exception = null) 40public override void Complete(Exception? exception = null)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (3)
15public Exception? CompleteException { get; private set; } 33public override void Complete(Exception? exception = null) 40public override ValueTask CompleteAsync(Exception? exception = null)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
34catch (Exception ex) 49catch (Exception ex) 60catch (Exception ex)
src\Servers\Kestrel\shared\test\DummyApplication.cs (1)
38public void DisposeContext(HttpContext context, Exception exception)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
141return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, expectedErrorCode: expectedErrorCode ?? 0, matchExpectedErrorMessage: null); 145where TException : Exception 177private void AssertConnectionError<TException>(Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) where TException : Exception
src\Servers\Kestrel\shared\test\MockLogger.cs (2)
21public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
52public override void Complete(Exception exception = null) => _output.Complete(exception); 76public override void Complete(Exception exception = null) => _input.Complete(exception);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (7)
92catch (Exception) 113catch (Exception) 134catch (Exception e) 148catch (Exception) 164catch (Exception) 228catch (Exception e) 319catch (Exception e)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
34catch (Exception ex)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
TestTransport\InMemoryTransportConnection.cs (1)
140public override void Complete(Exception exception = null)
UpgradeTests.cs (5)
92catch (Exception ex) 130catch (Exception e) 279catch (Exception e) 366catch (Exception ex) 412catch (Exception ex)
InProcessWebSite (7)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (7)
319catch (Exception exception) 355catch (Exception exception) 377catch (Exception exception) 790catch (Exception) 976catch (Exception) 1170catch (Exception exception) 1191catch (Exception exception)
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
61catch (Exception e)
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
61catch (Exception e)
Interop.FunctionalTests (30)
H2SpecCommands.cs (1)
260catch (Exception ex)
Http2WebSocketInteropTests.cs (4)
123catch (Exception ex) 154var ex = await Assert.ThrowsAnyAsync<Exception>(() => tcs.Task); 161await Assert.ThrowsAnyAsync<Exception>(() => wsClient.ReceiveAsync(new byte[1], default));
Http3\Http3RequestTests.cs (7)
209public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1208catch (Exception ex) 1390catch (Exception ex) 2074var ex = await Assert.ThrowsAnyAsync<Exception>(() => readTask).DefaultTimeout(); 2076var rootException = ex;
HttpClientHttp2InteropTests.cs (15)
361catch (Exception ex) 420catch (Exception ex) 489catch (Exception ex) 719catch (Exception ex) 778catch (Exception ex) 828catch (Exception ex) 849await Assert.ThrowsAnyAsync<Exception>(() => requestTask).DefaultTimeout(); 875catch (Exception ex) 894await Assert.ThrowsAnyAsync<Exception>(() => requestTask).DefaultTimeout(); 919catch (Exception ex) 960catch (Exception ex) 1001catch (Exception ex) 1043catch (Exception ex) 1096catch (Exception ex) 1152catch (Exception ex)
HttpHelpers.cs (2)
22public static HttpProtocolException GetProtocolException(this Exception ex) 24var current = ex;
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
34catch (Exception ex)
InteropClient (4)
Assert.cs (4)
62public static async Task<TException> ThrowsAsync<TException>(Func<Task> action) where TException : Exception 68catch (Exception ex) 81public static TException Throws<TException>(Action action) where TException : Exception 87catch (Exception ex)
InteropTests (2)
InteropTests.cs (2)
86catch (Exception ex) 109catch (Exception ex)
JwtClientSample (1)
Program.cs (1)
76catch (Exception ex)
Microsoft.Analyzers.Extra.Tests (1)
CallAnalysis\LegacyLoggingTests.Extra.cs (1)
167var exception = await Record.ExceptionAsync(async () =>
Microsoft.Analyzers.Local (1)
ApiLifecycle\ModelLoader.cs (1)
73catch (Exception)
Microsoft.Analyzers.Local.Tests (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Arcade.Test.Common (2)
AssertEx.cs (2)
368public static T Throws<T>(Action del, bool allowDerived = false) where T : Exception 374catch (Exception ex)
Microsoft.AspNetCore.Antiforgery (9)
AntiforgeryValidationException.cs (3)
7/// The <see cref="Exception"/> that is thrown when the antiforgery token validation fails. 26/// <param name="innerException">The inner <see cref="Exception"/>.</param> 27public AntiforgeryValidationException(string message, Exception? innerException)
Internal\AntiforgeryLoggerExtensions.cs (2)
30public static partial void TokenDeserializeException(this ILogger logger, Exception exception); 38public static partial void FailedToDeserialzeTokens(this ILogger logger, Exception exception);
Internal\AntiforgeryValidationFeature.cs (1)
10public Exception? Error { get; } = exception;
Internal\DefaultAntiforgery.cs (1)
334catch (Exception ex)
Internal\DefaultAntiforgeryTokenSerializer.cs (2)
33Exception? innerException = null; 58catch (Exception ex)
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (3)
167catch (Exception ex) 226catch (Exception ex) 359catch (Exception ex)
Microsoft.AspNetCore.AsyncState (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.AspNetCore.Authentication (9)
AuthenticationHandler.cs (1)
269catch (Exception ex)
Events\RemoteAuthenticationContext.cs (1)
48public void Fail(Exception failure) => Result = HandleRequestResult.Fail(failure);
Events\RemoteFailureContext.cs (2)
24Exception failure) 33public Exception? Failure { get; set; }
Events\ResultContext.cs (1)
62public void Fail(Exception failure) => Result = AuthenticateResult.Fail(failure);
HandleRequestResult.cs (2)
43public static new HandleRequestResult Fail(Exception failure) 54public static new HandleRequestResult Fail(Exception failure, AuthenticationProperties? properties)
RemoteAuthenticationHandler.cs (2)
83Exception? exception = null; 108catch (Exception ex)
Microsoft.AspNetCore.Authentication.Abstractions (4)
AuthenticateResult.cs (3)
45public Exception? Failure { get; protected set; } 99public static AuthenticateResult Fail(Exception failure) 110public static AuthenticateResult Fail(Exception failure, AuthenticationProperties? properties)
AuthenticationFailureException.cs (1)
28public AuthenticationFailureException(string? message, Exception? innerException)
Microsoft.AspNetCore.Authentication.Certificate (3)
CertificateAuthenticationHandler.cs (2)
92catch (Exception ex) 104private async Task<CertificateAuthenticationFailedContext> HandleFailureAsync(Exception error)
Events\CertificateAuthenticationFailedContext.cs (1)
30public Exception Exception { get; set; } = default!;
Microsoft.AspNetCore.Authentication.Core (21)
AuthenticationMetrics.cs (11)
53public void AuthenticatedRequestCompleted(string? scheme, AuthenticateResult? result, Exception? exception, long startTimestamp, long currentTimestamp) 62private void AuthenticatedRequestCompletedCore(string? scheme, AuthenticateResult? result, Exception? exception, long startTimestamp, long currentTimestamp) 91public void ChallengeCompleted(string? scheme, Exception? exception) 100private void ChallengeCompletedCore(string? scheme, Exception? exception) 117public void ForbidCompleted(string? scheme, Exception? exception) 126private void ForbidCompletedCore(string? scheme, Exception? exception) 143public void SignInCompleted(string? scheme, Exception? exception) 152private void SignInCompletedCore(string? scheme, Exception? exception) 169public void SignOutCompleted(string? scheme, Exception? exception) 178private void SignOutCompletedCore(string? scheme, Exception? exception) 200private static void AddErrorTag(ref TagList tags, Exception exception)
AuthenticationService.cs (5)
218private async Task<Exception> CreateMissingHandlerException(string scheme) 241private async Task<Exception> CreateMissingSignInHandlerException(string scheme) 258private async Task<Exception> CreateMismatchedSignInHandlerException(string scheme, IAuthenticationHandler handler) 281private async Task<Exception> CreateMissingSignOutHandlerException(string scheme) 297private async Task<Exception> CreateMismatchedSignOutHandlerException(string scheme, IAuthenticationHandler handler)
AuthenticationServiceImpl.cs (5)
27catch (Exception ex) 43catch (Exception ex) 58catch (Exception ex) 73catch (Exception ex) 88catch (Exception ex)
Microsoft.AspNetCore.Authentication.JwtBearer (16)
AuthenticationFailedContext.cs (1)
26public Exception Exception { get; set; } = default!;
JwtBearerChallengeContext.cs (1)
27public Exception? AuthenticateFailure { get; set; }
JwtBearerHandler.cs (12)
97List<Exception>? validationFailures = null; 116validationFailures ??= new List<Exception>(1); 120catch (Exception ex) 122validationFailures ??= new List<Exception>(1); 138catch (Exception ex) 140validationFailures ??= new List<Exception>(1); 203catch (Exception ex) 222private void RecordTokenValidationError(Exception exception, List<Exception> exceptions) 369private static string CreateErrorDescription(Exception authFailure) 371IReadOnlyCollection<Exception> exceptions; 383foreach (var ex in exceptions)
LoggingExtensions.cs (2)
9public static partial void TokenValidationFailed(this ILogger logger, Exception ex); 15public static partial void ErrorProcessingMessage(this ILogger logger, Exception ex);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
UserJwtsTestFixture.cs (1)
115catch (Exception)
UserJwtsTests.cs (1)
313var exception = Record.Exception(() => app.Run(new[] { "not-real", "--project", project }));
Microsoft.AspNetCore.Authentication.Negotiate (9)
Events\AuthenticationFailedContext.cs (1)
26public Exception Exception { get; set; } = default!;
Internal\INegotiateState.cs (1)
11string? GetOutgoingBlob(string incomingBlob, out BlobErrorType status, out Exception? error);
Internal\NegotiateLoggingExtensions.cs (3)
21public static partial void ExceptionProcessingAuth(this ILogger logger, Exception ex); 33public static partial void CredentialError(this ILogger logger, Exception ex); 36public static partial void ClientError(this ILogger logger, Exception ex);
Internal\NegotiateState.cs (1)
20public string? GetOutgoingBlob(string incomingBlob, out BlobErrorType status, out Exception? error)
NegotiateHandler.cs (3)
137var outgoing = _negotiateState.GetOutgoingBlob(token, out var errorType, out var exception); 237catch (Exception ex) 267private async Task<bool?> InvokeAuthenticateFailedEvent(Exception ex)
Microsoft.AspNetCore.Authentication.Negotiate.Test (9)
EventTests.cs (6)
128Assert.IsType<Exception>(context.Exception); 136var ex = await Assert.ThrowsAsync<Exception>(() => 179Assert.IsType<Exception>(context.Exception); 229Assert.IsType<Exception>(context.Exception); 529public string GetOutgoingBlob(string incomingBlob, out BlobErrorType errorType, out Exception ex)
NegotiateHandlerTests.cs (3)
322var ex = await Assert.ThrowsAsync<Exception>(() => SendAsync(server, "/404", testConnection, "Negotiate OtherError")); 553public string GetOutgoingBlob(string incomingBlob, out BlobErrorType errorType, out Exception ex)
Microsoft.AspNetCore.Authentication.OAuth (5)
OAuthHandler.cs (1)
234var exception = OAuthTokenResponse.GetStandardErrorException(JsonDocument.Parse(body));
OAuthTokenResponse.cs (4)
29private OAuthTokenResponse(Exception error) 49public static OAuthTokenResponse Failed(Exception error) 91public Exception? Error { get; set; } 93internal static Exception? GetStandardErrorException(JsonDocument response)
Microsoft.AspNetCore.Authentication.OpenIdConnect (7)
Events\AuthenticationFailedContext.cs (1)
30public Exception Exception { get; set; } = default!;
LoggingExtensions.cs (2)
102public static partial void ExceptionProcessingMessage(this ILogger logger, Exception ex); 114public static partial void UnableToProtectNonceCookie(this ILogger logger, Exception ex);
OpenIdConnectHandler.cs (4)
924catch (Exception exception) 1015catch (Exception ex) 1194catch (Exception ex) 1355private async Task<AuthenticationFailedContext> RunAuthenticationFailedEventAsync(OpenIdConnectMessage message, Exception exception)
Microsoft.AspNetCore.Authentication.Test (36)
GoogleTests.cs (14)
371var error = await Assert.ThrowsAnyAsync<Exception>(() => server.SendAsync("https://example.com/signin-google?code=TestCode")); 406var error = await Assert.ThrowsAnyAsync<Exception>(() => sendTask); 463var ex = ctx.Failure; 500var ex = ctx.Failure; 524var error = await Assert.ThrowsAnyAsync<Exception>(() => sendTask); 634var error = await Assert.ThrowsAnyAsync<Exception>(() => sendTask); 686var error = await Assert.ThrowsAnyAsync<Exception>(() => sendTask); 824var error = await Assert.ThrowsAnyAsync<Exception>(() => server.SendAsync("https://example.com/signin-google?code=TestCode"));
JwtBearerTests.cs (9)
206catch (Exception) 614var exception = await Assert.ThrowsAsync<Exception>(delegate 686var exception = await Assert.ThrowsAsync<Exception>(delegate 758var exception = await Assert.ThrowsAsync<Exception>(delegate 1040var exception = (Exception)constructor.Invoke(new[] { ExceptionType.Name });
JwtBearerTests_Handler.cs (9)
193catch (Exception) 575var exception = await Assert.ThrowsAsync<Exception>(delegate 641var exception = await Assert.ThrowsAsync<Exception>(delegate 707var exception = await Assert.ThrowsAsync<Exception>(delegate 1118var exception = (Exception)constructor.Invoke(new[] { ExceptionType.Name });
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (1)
80var ex = ctx.Failure;
OpenIdConnect\OpenIdConnectConfigurationTests.cs (1)
574where T : Exception
TwitterTests.cs (2)
119var error = await Assert.ThrowsAnyAsync<Exception>(() => server.SendAsync("https://example.com/signin-twitter"));
Microsoft.AspNetCore.Authentication.WsFederation (11)
AuthenticationFailedContext.cs (1)
32public Exception Exception { get; set; } = default!;
LoggingExtensions.cs (1)
15public static partial void ExceptionProcessingMessage(this ILogger logger, Exception ex);
WsFederationHandler.cs (9)
179List<Exception>? validationFailures = null; 263validationFailures ??= new List<Exception>(1); 264Exception exception = tokenValidationResult.Exception ?? new SecurityTokenValidationException($"The TokenHandler: '{tokenHandler}', was unable to validate the Token."); 269catch (Exception ex) 271validationFailures ??= new List<Exception>(1); 289catch (Exception ex) 291validationFailures ??= new List<Exception>(1); 351catch (Exception exception) 397private void RequestRefresh(Exception exception)
Microsoft.AspNetCore.Authorization (4)
AuthorizationMetrics.cs (2)
33public void AuthorizedRequestCompleted(ClaimsPrincipal user, string? policyName, AuthorizationResult? result, Exception? exception) 42private void AuthorizedRequestCompletedCore(ClaimsPrincipal user, string? policyName, AuthorizationResult? result, Exception? exception)
DefaultAuthorizationServiceImpl.cs (2)
31catch (Exception ex) 53catch (Exception ex)
Microsoft.AspNetCore.Authorization.Test (10)
DefaultAuthorizationServiceTests.cs (10)
1160private readonly Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> _assertion; 1162public DefaultAuthorizationServiceTestLogger(Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> assertion) 1177public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1188static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter) 1221static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter)
Microsoft.AspNetCore.Components (54)
ComponentBase.cs (2)
224/// <param name="exception">The <see cref="Exception"/> that will be dispatched to the renderer.</param> 226protected Task DispatchExceptionAsync(Exception exception)
ErrorBoundaryBase.cs (6)
23[Parameter] public RenderFragment<Exception>? ErrorContent { get; set; } 34protected Exception? CurrentException { get; private set; } 54/// <param name="exception">The <see cref="Exception"/> being handled.</param> 55protected abstract Task OnErrorAsync(Exception exception); 57void IErrorBoundary.HandleException(Exception exception) 110catch (Exception exception)
IErrorBoundary.cs (1)
19void HandleException(Exception error);
Infrastructure\ComponentStatePersistenceManager.cs (2)
176catch (Exception ex) 188catch (Exception ex)
LocationChangeException.cs (1)
16public LocationChangeException(string message, Exception innerException)
NavigationManager.cs (3)
305catch (Exception ex) 452catch (Exception ex) 463protected virtual void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context)
Reflection\ComponentProperties.cs (1)
169catch (Exception ex)
RenderHandle.cs (3)
102/// Dispatches an <see cref="Exception"/> to the <see cref="Renderer"/>. 104/// <param name="exception">The <see cref="Exception"/> that will be dispatched to the renderer.</param> 106public Task DispatchExceptionAsync(Exception exception)
Rendering\ComponentState.cs (4)
90internal void RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, out Exception? renderFragmentException) 107catch (Exception ex) 145catch (Exception ex) 238catch (Exception ex)
Rendering\RendererSynchronizationContext.cs (6)
69catch (Exception exception) 107catch (Exception exception) 130catch (Exception exception) 150catch (Exception exception) 199catch (Exception ex) 253private void DispatchException(Exception ex) =>
RenderTree\Renderer.cs (22)
325/// <param name="exception">The <see cref="Exception"/>.</param> 326protected abstract void HandleException(Exception exception); 477catch (Exception e) 589var baseException = task.Exception.GetBaseException(); 780catch (Exception e) 925componentState.RenderIntoBatch(_batchBuilder, renderQueueEntry.RenderFragment, out var renderFragmentException); 938List<Exception> exceptions = null; 966catch (Exception e) 973catch (Exception exception) 975exceptions ??= new List<Exception>(); 1031catch (Exception) 1048catch (Exception ex) 1070internal void HandleComponentException(Exception exception, int componentId) 1077private void HandleExceptionViaErrorBoundary(Exception error, ComponentState? errorSourceOrNull) 1107catch (Exception errorBoundaryException) 1173List<Exception> exceptions = null; 1194catch (Exception exception) 1196exceptions ??= new List<Exception>(); 1214List<Exception> asyncExceptions = null; 1221catch (Exception exception) 1223asyncExceptions ??= new List<Exception>(); 1231void NotifyExceptions(List<Exception> exceptions)
Routing\Router.cs (1)
308catch (Exception e)
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
61catch (Exception exception)
src\Http\Routing\src\RouteCreationException.cs (1)
30public RouteCreationException(string message, Exception innerException)
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererAsBaseClass.cs (1)
18protected override void HandleException(Exception exception)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererTypesInDeclarations.cs (1)
23protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.Authorization.Tests (5)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (4)
44public List<Exception> HandledExceptions { get; } = new List<Exception>(); 85var exception = task.Exception.Flatten().InnerException; 100protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.Endpoints (14)
Builder\OpaqueRedirection.cs (1)
105public static partial void OpaqueUrlUnprotectionFailed(ILogger<OpaqueRedirection> logger, Exception exception);
DependencyInjection\DefaultRazorComponentsServiceOptionsConfiguration.cs (1)
64catch (Exception)
DependencyInjection\PrerenderingErrorBoundaryLogger.cs (2)
11private static readonly Action<ILogger, string, Exception> _exceptionCaughtByErrorBoundary = LoggerMessage.Define<string>( 23public ValueTask LogErrorAsync(Exception exception)
FormMapping\Converters\CollectionConverter.cs (1)
243catch (Exception ex)
FormMapping\Converters\CompiledComplexTypeConverter.cs (1)
23catch (Exception ex)
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
39var exceptionVar = Expression.Variable(typeof(Exception), "mappingException"); 145var exception = Expression.Variable(typeof(Exception), "constructorException");
FormMapping\FormDataMapper.cs (2)
27catch (Exception ex) 46public static partial void CannotResolveConverter(ILogger logger, Type type, Exception? ex);
FormMapping\FormDataMappingException.cs (1)
10public FormDataMappingException(FormDataMappingError error, Exception? innerException)
FormMapping\FormDataReader.cs (1)
83public void AddMappingError(Exception exception, string? attemptedValue)
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
78catch (Exception ex) 212private static void HandleExceptionAfterResponseStarted(HttpContext httpContext, TextWriter writer, Exception exception)
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
ImportMapTest.cs (4)
269public List<Exception> HandledExceptions { get; } = new List<Exception>(); 318var exception = task.Exception.Flatten().InnerException; 333protected override void HandleException(Exception exception)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
Microsoft.AspNetCore.Components.Forms.Tests (5)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (4)
44public List<Exception> HandledExceptions { get; } = new List<Exception>(); 85var exception = task.Exception.Flatten().InnerException; 100protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.Performance (1)
RenderTreeDiffBuilderBenchmark.cs (1)
95protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererAsBaseClass.cs (1)
18protected override void HandleException(Exception exception)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsesRendererTypesInDeclarations.cs (1)
23protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.Server (116)
BlazorPack\BlazorPackHubProtocolWorker.cs (1)
63catch (Exception ex)
Circuits\CircuitHost.cs (50)
161catch (Exception ex) 221catch (Exception ex) 236List<Exception> exceptions = null; 245catch (Exception ex) 248exceptions ??= new List<Exception>(); 265List<Exception> exceptions = null; 274catch (Exception ex) 277exceptions ??= new List<Exception>(); 294List<Exception> exceptions = null; 303catch (Exception ex) 306exceptions ??= new List<Exception>(); 321List<Exception> exceptions = null; 330catch (Exception ex) 333exceptions ??= new List<Exception>(); 356catch (Exception e) 382catch (Exception ex) 416catch (Exception ex) 441catch (Exception ex) 465catch (Exception ex) 485catch (Exception ex) 515catch (Exception ex) 560catch (Exception ex) 585catch (Exception ex) 669private async void ReportAndInvoke_UnhandledException(object sender, Exception e) 679await ReportUnhandledException((Exception)e.ExceptionObject); 683private async Task ReportUnhandledException(Exception exception) 690private string GetClientErrorMessage(Exception exception, string additionalInformation = null) 706private async Task TryNotifyClientErrorAsync(IClientProxy client, string error, Exception exception = null) 723catch (Exception ex) 787catch (Exception ex) 880public static partial void InitializationFailed(ILogger logger, Exception exception); 889public static partial void DisposeFailed(ILogger logger, CircuitId circuitId, Exception exception); 904private static partial void CircuitHandlerFailed(ILogger logger, Type handlerType, string handlerMethod, string message, Exception exception); 913public static partial void UpdateRootComponentsFailed(ILogger logger, Exception exception); 915public static void CircuitHandlerFailed(ILogger logger, CircuitHandler handler, string handlerMethod, Exception exception) 926public static partial void CircuitUnhandledException(ILogger logger, CircuitId circuitId, Exception exception); 935public static partial void CircuitTransmitErrorFailed(ILogger logger, CircuitId circuitId, Exception exception); 938public static partial void UnhandledExceptionClientDisconnected(ILogger logger, CircuitId circuitId, Exception exception); 944public static partial void DispatchEventFailedToParseEventData(ILogger logger, Exception ex); 947public static partial void DispatchEventFailedToDispatchEvent(ILogger logger, string eventHandlerId, Exception ex); 953private static partial void BeginInvokeDotNetFailed(ILogger logger, string methodIdentifier, long dotNetObjectId, string callId, Exception exception); 956public static partial void EndInvokeDispatchException(ILogger logger, Exception ex); 971public static partial void LocationChangeFailed(ILogger logger, string uri, CircuitId circuitId, Exception exception); 977public static partial void OnRenderCompletedFailed(ILogger logger, long renderId, CircuitId circuitId, Exception e); 983public static partial void ReceiveByteArrayException(ILogger logger, long id, Exception ex); 986public static partial void ReceiveJSDataChunkException(ILogger logger, long streamId, Exception ex); 989public static partial void SendDotNetStreamException(ILogger logger, long id, Exception ex); 1007private static partial void BeginInvokeDotNetStaticFailed(ILogger logger, string methodIdentifier, string assembly, string callId, Exception exception); 1009public static void BeginInvokeDotNetFailed(ILogger logger, string callId, string assemblyName, string methodIdentifier, long dotNetObjectId, Exception exception) 1022public static partial void LocationChangeFailedInCircuit(ILogger logger, string uri, CircuitId circuitId, Exception exception);
Circuits\CircuitIdFactory.cs (1)
80catch (Exception)
Circuits\CircuitRegistry.cs (10)
218catch (Exception ex) 290catch (Exception ex) 302catch (Exception ex) 345catch (Exception ex) 367private static partial void UnhandledExceptionDisposingCircuitHost(ILogger logger, string message, Exception exception); 369public static void UnhandledExceptionDisposingCircuitHost(ILogger logger, Exception exception) 373private static partial void ExceptionDisposingTokenSource(ILogger logger, string message, Exception exception); 375public static void ExceptionDisposingTokenSource(ILogger logger, Exception exception) 391public static partial void FailedToReconnectToCircuit(ILogger logger, CircuitId circuitId, Exception exception = null); 412public static partial void CircuitExceptionHandlerFailed(ILogger logger, CircuitId circuitId, Exception exception);
Circuits\ComponentParameterDeserializer.cs (4)
72catch (Exception e) 96internal static partial void InvalidParameterValue(ILogger<ComponentParameterDeserializer> logger, string name, string typeName, string assembly, Exception e); 99internal static partial void FailedToParseParameterDefinitions(ILogger<ComponentParameterDeserializer> logger, Exception e); 102internal static partial void FailedToParseParameterValues(ILogger<ComponentParameterDeserializer> logger, Exception e);
Circuits\RemoteErrorBoundaryLogger.cs (2)
24public ValueTask LogErrorAsync(Exception exception) 48public static partial void ExceptionCaughtByErrorBoundary(ILogger logger, string message, Exception exception);
Circuits\RemoteJSDataStream.cs (2)
134catch (Exception e) 217private async Task CompletePipeAndDisposeStream(Exception? ex = null)
Circuits\RemoteJSRuntime.cs (5)
38public event EventHandler<Exception>? UnhandledException; 60internal void RaiseUnhandledException(Exception ex) 225private static partial void InvokeStaticDotNetMethodException(ILogger logger, string assemblyName, string methodIdentifier, string? callbackId, Exception exception); 228private static partial void InvokeInstanceDotNetMethodException(ILogger logger, string methodIdentifier, long dotNetObjectReference, string? callbackId, Exception exception); 236internal static void InvokeDotNetMethodException(ILogger logger, in DotNetInvocationInfo invocationInfo, Exception exception)
Circuits\RemoteNavigationManager.cs (6)
21public event EventHandler<Exception>? UnhandledException; 116catch (Exception ex) 143catch (Exception ex) 151protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context) 195public static partial void NavigationFailed(ILogger logger, string uri, Exception exception); 198public static partial void RefreshFailed(ILogger logger, Exception exception);
Circuits\RemoteRenderer.cs (9)
35public event EventHandler<Exception>? UnhandledException; 115protected override void HandleException(Exception exception) 119foreach (var innerException in aggregateException.Flatten().InnerExceptions) 224catch (Exception e) 366catch (Exception exception) 375private static partial void UnhandledExceptionRenderingComponent(ILogger logger, string message, Exception exception); 377public static void UnhandledExceptionRenderingComponent(ILogger logger, Exception exception) 387private static partial void SendBatchDataFailed(ILogger logger, string message, Exception exception); 389public static void SendBatchDataFailed(ILogger logger, Exception exception)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
95catch (Exception ex)
Circuits\ServerComponentDeserializer.cs (6)
250catch (Exception e) 264catch (Exception e) 343catch (Exception ex) 361public static partial void FailedToDeserializeDescriptor(ILogger<ServerComponentDeserializer> logger, Exception e); 367public static partial void FailedToUnprotectDescriptor(ILogger<ServerComponentDeserializer> logger, Exception e); 394public static partial void FailedToProcessRootComponentOperations(ILogger logger, Exception exception);
ComponentHub.cs (3)
70public override Task OnDisconnectedAsync(Exception exception) 153catch (Exception ex) 390public static partial void CircuitInitializationFailed(ILogger logger, Exception exception);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (12)
94catch (Exception ex) 124catch (Exception ex) 151catch (Exception ex) 195catch (Exception ex) 316catch (Exception ex) 621catch (Exception ex) 633catch (Exception ex) 645catch (Exception ex) 665catch (Exception ex) 677catch (Exception ex) 689catch (Exception ex) 701catch (Exception ex)
src\SignalR\common\Shared\TryGetReturnType.cs (1)
19catch (Exception)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (2)
933private static EndOfStreamException ThrowNotEnoughBytesException(Exception innerException) => throw new EndOfStreamException(new EndOfStreamException().Message, innerException); 940private static Exception ThrowInvalidCode(byte code)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackSerializationException.cs (1)
40public MessagePackSerializationException(string message, Exception inner)
Microsoft.AspNetCore.Components.Server.Tests (8)
Circuits\CircuitHostTest.cs (2)
823public Exception ExceptionDuringDisposeAsync { get; private set; } 838catch (Exception ex)
Circuits\RemoteRendererTest.cs (4)
236var exceptions = new List<Exception>(); 299var exceptions = new List<Exception>(); 360var exceptions = new List<Exception>(); 417var exceptions = new List<Exception>();
Circuits\RenderBatchWriterTest.cs (1)
394protected override void HandleException(Exception exception)
ProtectedBrowserStorageTest.cs (1)
232var innerException = ex.InnerException;
Microsoft.AspNetCore.Components.Tests (40)
ComponentFactoryTest.cs (1)
426protected override void HandleException(Exception exception)
Lifetime\ComponentStatePersistenceManagerTest.cs (1)
247protected override void HandleException(Exception exception)
NavigationManagerTest.cs (6)
701var ex = Assert.Single(navigationManager.ExceptionsThrownFromLocationChangingHandlers); 732var ex = Assert.Single(navigationManager.ExceptionsThrownFromLocationChangingHandlers); 758var ex = Assert.Single(navigationManager.ExceptionsThrownFromLocationChangingHandlers); 902private readonly List<Exception> _exceptionsThrownFromLocationChangingHandlers = new(); 904public IReadOnlyList<Exception> ExceptionsThrownFromLocationChangingHandlers => _exceptionsThrownFromLocationChangingHandlers; 911protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context)
RendererTest.cs (23)
719var exception = Assert.Single(renderer.HandledExceptions); 2270var exception1 = new Exception(); 2271var exception2 = new Exception(); 2337var aex = Assert.Single(renderer.HandledExceptions); 2547var exception1 = new Exception(); 2548var exception2 = new Exception(); 2603var ex = Assert.IsType<Exception>(Assert.Single(renderer.HandledExceptions)); 3982public static readonly Exception Exception = new InvalidTimeZoneException(); 4022public static readonly Exception Exception = new InvalidTimeZoneException(); 4236var exception1 = new Exception(); 4237var exception2 = new Exception(); 4285var handledException = Assert.Single(renderer.HandledExceptions); 4318var handledException = Assert.Single(renderer.HandledExceptions); 4577Exception exception = null; 5176protected override void HandleException(Exception exception) 5211var exception = t.Exception.Flatten().InnerException; 5839public Task ExternalExceptionDispatch(Exception exception) 5970public Exception ReceivedException { get; private set; } 5978public void HandleException(Exception error) 6001[Parameter] public Exception ThrowDuringRender { get; set; } 6002[Parameter] public Exception ThrowDuringEventSync { get; set; } 6004[Parameter] public Exception ThrowDuringParameterSettingSync { get; set; }
Rendering\RendererSynchronizationContextTest.cs (2)
44Exception exception = null; 164Exception exception = null;
Rendering\RenderTreeBuilderTest.cs (1)
2299protected override void HandleException(Exception exception)
RenderTreeDiffBuilderTest.cs (1)
2463protected override void HandleException(Exception exception)
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (4)
44public List<Exception> HandledExceptions { get; } = new List<Exception>(); 85var exception = task.Exception.Flatten().InnerException; 100protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.Web (10)
HtmlRendering\StaticHtmlRenderer.cs (1)
82protected override void HandleException(Exception exception)
Virtualization\Virtualize.cs (3)
50private Exception? _refreshException; 218var oldRefreshException = _refreshException; 433catch (Exception e)
Web\ErrorBoundary.cs (2)
19/// <param name="exception">The <see cref="Exception"/> being handled.</param> 20protected override async Task OnErrorAsync(Exception exception)
Web\IErrorBoundaryLogger.cs (2)
17/// <param name="exception">The <see cref="Exception"/> to log.</param> 19ValueTask LogErrorAsync(Exception exception);
WebEventData\WebEventData.cs (2)
27catch (Exception e) 81catch (Exception e)
Microsoft.AspNetCore.Components.Web.Tests (6)
Forms\InputSelectTest.cs (1)
205var exception = Record.Exception(() => inputSelectComponent.Element);
src\Components\Shared\test\AutoRenderComponent.cs (1)
33var exception = t.Exception.Flatten().InnerException;
src\Components\Shared\test\TestRenderer.cs (4)
44public List<Exception> HandledExceptions { get; } = new List<Exception>(); 85var exception = task.Exception.Flatten().InnerException; 100protected override void HandleException(Exception exception)
Microsoft.AspNetCore.Components.WebAssembly (22)
Hosting\WebAssemblyHost.cs (1)
201catch (Exception ex)
HotReload\HotReloadAgent.cs (3)
125catch (Exception ex) 220catch (Exception ex) 266catch (Exception ex)
Prerendering\WebAssemblyComponentParameterDeserializer.cs (1)
67catch (Exception e)
Rendering\WebAssemblyDispatcher.cs (4)
42catch (Exception ex) 70catch (Exception ex) 114catch (Exception ex) 158catch (Exception ex)
Rendering\WebAssemblyRenderer.cs (3)
172protected override void HandleException(Exception exception) 176foreach (var innerException in aggregateException.Flatten().InnerExceptions) 197public static partial void UnhandledExceptionRenderingComponent(ILogger logger, string message, Exception exception);
Services\DefaultWebAssemblyJSRuntime.cs (1)
104catch (Exception ex)
Services\WebAssemblyConsoleLogger.cs (4)
44public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 61private void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception? exception) 107private static void CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception? exception)
Services\WebAssemblyErrorBoundaryLogger.cs (1)
18public ValueTask LogErrorAsync(Exception exception)
Services\WebAssemblyNavigationManager.cs (3)
73catch (Exception ex) 88protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context) 102public static partial void NavigationFailed(ILogger logger, string uri, Exception exception);
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
30catch (Exception ex)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
123catch (Exception) 277catch (Exception ex)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\WebAssemblyHostConfigurationTest.cs (1)
117var exception = Record.Exception(() => configuration.Dispose());
Microsoft.AspNetCore.Components.WebView (10)
IpcSender.cs (2)
77public void NotifyUnhandledException(Exception exception) 102catch (Exception ex)
Services\WebViewErrorBoundaryLogger.cs (1)
18public ValueTask LogErrorAsync(Exception exception)
Services\WebViewNavigationManager.cs (4)
49catch (Exception ex) 77catch (Exception ex) 93protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context) 110public static partial void NavigationFailed(ILogger logger, string uri, Exception exception);
Services\WebViewRenderer.cs (1)
39protected override void HandleException(Exception exception)
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
30catch (Exception ex)
WebViewManager.cs (1)
161catch (Exception ex)
Microsoft.AspNetCore.Components.WebView.Maui (7)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
149 catch (Exception ex)
src\Core\src\TaskExtensions.cs (6)
13 Action<Exception>? errorCallback = null) 20 catch (Exception exc) 31 Action<Exception>? errorCallback = null 38 catch (Exception ex) 61 static void Log(ILogger? logger, Exception ex, string? callerName) => 71 catch (Exception ex)
Microsoft.AspNetCore.Components.WebView.Photino (7)
PhotinoSynchronizationContext.cs (7)
74catch (Exception exception) 98catch (Exception exception) 122catch (Exception exception) 146catch (Exception exception) 277catch (Exception ex) 290catch (Exception ex) 296private void DispatchException(Exception ex)
Microsoft.AspNetCore.Components.WebView.WindowsForms (8)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
149 catch (Exception ex)
WindowsFormsDispatcher.cs (7)
18 private static Action<Exception> RethrowException = exception => 55 catch (Exception ex) 89 catch (Exception ex) 99 catch (Exception ex) 123 catch (Exception ex) 157 catch (Exception ex) 168 catch (Exception ex)
Microsoft.AspNetCore.Components.WebView.Wpf (6)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
149 catch (Exception ex)
WpfDispatcher.cs (5)
20 private static Action<Exception> RethrowException = exception => 39 catch (Exception ex) 62 catch (Exception ex) 85 catch (Exception ex) 108 catch (Exception ex)
Microsoft.AspNetCore.Components.WebViewE2E.Test (4)
BasicBlazorHybridTest.cs (3)
54catch (Exception ex) 136catch (Exception ex) 154catch (Exception ex)
Program.cs (1)
25catch (Exception ex)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
src\Shared\AsyncEnumerableExtensions.cs (1)
30catch (Exception ex)
Microsoft.AspNetCore.Connections.Abstractions (6)
Exceptions\AddressInUseException.cs (2)
25/// <param name="inner">The underlying <see cref="Exception"/>.</param> 26public AddressInUseException(string message, Exception inner) : base(message, inner)
Exceptions\ConnectionAbortedException.cs (2)
33/// <param name="inner">The underlying <see cref="Exception"/>.</param> 34public ConnectionAbortedException(string message, Exception inner) : base(message, inner)
Exceptions\ConnectionResetException.cs (2)
26/// <param name="inner">The underlying <see cref="Exception"/>.</param> 27public ConnectionResetException(string message, Exception inner) : base(message, inner)
Microsoft.AspNetCore.Cors (2)
CORSLoggerExtensions.cs (1)
35public static partial void FailedToSetCorsHeaders(this ILogger logger, Exception? exception);
Infrastructure\CorsMiddleware.cs (1)
200catch (Exception exception)
Microsoft.AspNetCore.Cors.Test (1)
CorsMiddlewareTests.cs (1)
585catch (Exception)
Microsoft.AspNetCore.Cryptography.Internal (1)
CryptoUtil.cs (1)
59public static Exception Fail(string message)
Microsoft.AspNetCore.DataProtection (49)
Cng\Internal\CngAuthenticatedEncryptorBase.cs (2)
35catch (Exception ex) when (ex.RequiresHomogenization()) 76catch (Exception ex) when (ex.RequiresHomogenization())
Error.cs (4)
29public static CryptographicException CryptCommon_GenericError(Exception? inner = null) 52public static CryptographicException Common_EncryptionFailed(Exception? inner = null) 74public static CryptographicException DecryptionFailed(Exception inner) 101public static InvalidOperationException KeyRingProvider_RefreshFailedOnOtherThread(Exception? inner)
Internal\DataProtectionHostedService.cs (1)
39catch (Exception ex)
KeyManagement\DefaultKeyResolver.cs (2)
95List<Exception>? exceptions = null; 114catch (Exception ex)
KeyManagement\Key.cs (3)
25private Exception? _descriptorException; 103Exception? descriptorException) 158catch (Exception ex)
KeyManagement\KeyRingBasedDataProtector.cs (2)
136catch (Exception ex) when (ex.RequiresHomogenization()) 289catch (Exception ex) when (ex.RequiresHomogenization())
KeyManagement\KeyRingProvider.cs (2)
276catch (Exception ex) 463catch (Exception e)
KeyManagement\XmlKeyManager.cs (4)
322catch (Exception ex) 366catch (Exception ex) 490private void WriteKeyDeserializationErrorToLog(Exception error, XElement keyElement) 587catch (Exception ex)
LoggingExtensions.cs (15)
77public static partial void KeyIsIneligibleToBeTheDefaultKeyBecauseItsMethodFailed(this ILogger logger, Guid keyId, string methodName, Exception exception); 104public static partial void ExceptionWhileProcessingRevocationElement(this ILogger logger, XElement revocationElement, Exception exception); 113public static partial void ExceptionWhileProcessingKeyElement(this ILogger logger, XElement element, Exception exception); 116public static partial void AnExceptionOccurredWhileProcessingElementDebug(this ILogger logger, XElement element, Exception exception); 122public static partial void AnErrorOccurredWhileEncryptingToX509CertificateWithThumbprint(this ILogger logger, string thumbprint, Exception exception); 128public static partial void ExceptionWhileTryingToResolveCertificateWithThumbprint(this ILogger logger, string thumbprint, Exception exception); 170public static partial void ExceptionOccurredTryingToDecryptElement(this ILogger logger, Exception exception); 182public static partial void ErrorOccurredWhileRefreshingKeyRing(this ILogger logger, Exception exception); 185public static partial void ErrorOccurredWhileReadingKeyRing(this ILogger logger, Exception exception); 203public static partial void ErrorOccurredWhileEncryptingToWindowsDPAPI(this ILogger logger, Exception exception); 209public static partial void ErrorOccurredWhileEncryptingToWindowsDPAPING(this ILogger logger, Exception exception); 236public static partial void KeyRingFailedToLoadOnStartup(this ILogger logger, Exception innerException); 257public static partial void RetryingMethodOfKeyAfterFailure(this ILogger logger, Guid keyId, string methodName, Exception exception); 263public static partial void FailedToDeleteFile(this ILogger logger, string fileName, Exception exception); 269public static partial void FailedToRemoveDataFromRegistryKeyValue(this ILogger logger, RegistryKey registryKeyName, string valueName, Exception exception);
Managed\AesGcmAuthenticatedEncryptor.cs (2)
139catch (Exception ex) when (ex.RequiresHomogenization()) 215catch (Exception ex) when (ex.RequiresHomogenization())
Managed\ManagedAuthenticatedEncryptor.cs (2)
268catch (Exception ex) when (ex.RequiresHomogenization()) 368catch (Exception ex) when (ex.RequiresHomogenization())
Repositories\FileSystemXmlRepository.cs (2)
43catch (Exception ex) 207catch (Exception ex)
Repositories\RegistryXmlRepository.cs (1)
189catch (Exception ex)
src\DataProtection\shared\src\ExceptionExtensions.cs (1)
15public static bool RequiresHomogenization(this Exception ex)
XmlEncryption\CertificateXmlEncryptor.cs (2)
114catch (Exception ex) 134catch (Exception ex)
XmlEncryption\DpapiNGXmlDecryptor.cs (1)
80catch (Exception ex)
XmlEncryption\DpapiNGXmlEncryptor.cs (1)
73catch (Exception ex)
XmlEncryption\DpapiXmlDecryptor.cs (1)
63catch (Exception ex)
XmlEncryption\DpapiXmlEncryptor.cs (1)
71catch (Exception ex)
Microsoft.AspNetCore.DataProtection.Abstractions (5)
CryptoUtil.cs (1)
19public static Exception Fail(string message)
DataProtectionCommonExtensions.cs (2)
167catch (Exception ex) when (ex.RequiresHomogenization()) 194catch (Exception ex) when (ex.RequiresHomogenization())
Error.cs (1)
12public static CryptographicException CryptCommon_GenericError(Exception? inner = null)
src\DataProtection\shared\src\ExceptionExtensions.cs (1)
15public static bool RequiresHomogenization(this Exception ex)
Microsoft.AspNetCore.DataProtection.Extensions (2)
src\DataProtection\shared\src\ExceptionExtensions.cs (1)
15public static bool RequiresHomogenization(this Exception ex)
TimeLimitedDataProtector.cs (1)
96catch (Exception ex) when (ex.RequiresHomogenization())
Microsoft.AspNetCore.DataProtection.Tests (7)
KeyManagement\DeferredKeyTests.cs (2)
76ExceptionAssert.Throws<Exception>(() => key.Descriptor, "How exceptional."); 77ExceptionAssert.Throws<Exception>(() => key.Descriptor, "How exceptional.");
KeyManagement\KeyRingProviderTests.cs (1)
744ExceptionAssert.Throws<Exception>(() => keyRingProvider.GetCurrentKeyRingCore(throwKeyRingTime, forceRefresh: true), "How exceptional."); // forceRefresh to wait for exception
StringLoggerFactory.cs (2)
61public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
TypeForwardingActivatorTests.cs (2)
38var exception = Assert.ThrowsAny<Exception>(() => activator.CreateInstance<object>(name));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (27)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
103catch (Exception e)
Microsoft.AspNetCore.Diagnostics (30)
DeveloperExceptionPage\DeveloperExceptionPageExtensions.cs (2)
15/// Captures synchronous and asynchronous <see cref="Exception"/> instances from the pipeline and generates HTML error responses. 31/// Captures synchronous and asynchronous <see cref="Exception"/> instances from the pipeline and generates HTML error responses.
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (3)
116catch (Exception ex) 174catch (Exception ex2) 336private Task DisplayRuntimeException(HttpContext context, Exception ex)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
468foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
DiagnosticsLoggerExtensions.cs (3)
12public static partial void UnhandledException(this ILogger logger, Exception exception); 22public static partial void ErrorHandlerException(this ILogger logger, Exception exception); 31public static partial void DisplayErrorPageException(this ILogger logger, Exception exception);
DiagnosticsTelemetry.cs (1)
12public static void ReportUnhandledException(ILogger logger, HttpContext context, Exception ex)
ExceptionHandler\ExceptionHandlerFeature.cs (1)
15public Exception Error { get; set; } = default!;
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (3)
85catch (Exception exception) 100catch (Exception exception) 221catch (Exception ex2)
ExceptionHandler\ExceptionHandlerOptions.cs (1)
48public Func<Exception, int>? StatusCodeSelector { get; set; }
ExceptionHandler\IExceptionHandler.cs (1)
26ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken);
src\Shared\StackTrace\ExceptionDetails\ExceptionDetails.cs (2)
16public ExceptionDetails(Exception error, IEnumerable<StackFrameSourceCodeInfo> stackFrames) 31public Exception? Error { get; }
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (9)
29public IEnumerable<ExceptionDetails> GetDetails(Exception exception) 33foreach (var ex in exceptions) 39private IEnumerable<StackFrameSourceCodeInfo> GetStackFrames(Exception original) 55private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception? ex) 62var typeLoadExceptions = new List<Exception>(); 63foreach (var loadException in typeLoadException.LoaderExceptions) 72var list = new List<Exception>(); 76foreach (var innerException in aggregateException.Flatten().InnerExceptions)
src\Shared\StackTrace\ExceptionDetails\LoggerExtensions.cs (1)
11public static partial void FailedToReadStackTraceInfo(this ILogger logger, Exception exception);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
21public static IList<StackFrameInfo> GetFrames(Exception exception, out AggregateException? error) 41List<Exception>? exceptions = null;
Microsoft.AspNetCore.Diagnostics.Abstractions (3)
ErrorContext.cs (2)
18public ErrorContext(HttpContext httpContext, Exception exception) 32public Exception Exception { get; }
IExceptionHandlerFeature.cs (1)
17Exception Error { get; }
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (16)
DatabaseDeveloperPageExceptionFilter.cs (1)
89catch (Exception e)
DatabaseErrorPageMiddleware.cs (9)
28public void Hold(Exception exception, Type contextType) 34public Exception? Exception { get; private set; } 91catch (Exception exception) 113catch (Exception e) 122private bool ShouldDisplayErrorPage(Exception exception) 126var lastRecordedException = _localDiagnostic.Value!.Exception; 137for (var e = exception; e != null && !match; e = e.InnerException) 187void IObserver<DiagnosticListener>.OnError(Exception error) 195void IObserver<KeyValuePair<string, object?>>.OnError(Exception error)
DiagnosticsEntityFrameworkCoreLoggerExtensions.cs (2)
26public static partial void MigrationsEndPointMiddlewareException(this ILogger logger, string contextTypeName, Exception exception); 50public static partial void DatabaseErrorPageMiddlewareException(this ILogger logger, Exception exception);
MigrationsEndPointMiddleware.cs (1)
84catch (Exception ex)
Views\DatabaseErrorPage.Designer.cs (1)
151for (Exception? ex = Model.Exception; ex != null; ex = ex.InnerException)
Views\DatabaseErrorPageModel.cs (2)
12Exception exception, 23public Exception Exception { get; }
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Log.cs (1)
12internal static partial void EnricherFailed(this ILogger logger, Exception exception, string enricher);
Logging\HttpLoggingRedactionInterceptor.cs (1)
162catch (Exception ex)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (1)
264var e = await Record.ExceptionAsync(() => Task.Delay(_timeSpanToDelay, cancellationToken));
Logging\AcceptanceTests.cs (2)
609var originalException = ex.InnerException?.InnerException; 643var originalException = ex.InnerException?.InnerException;
Logging\LoggingOptionsValidationTests.cs (2)
44var ex = Record.Exception( 60var ex = Record.Exception(
Microsoft.AspNetCore.Diagnostics.Tests (9)
ExceptionHandlerMiddlewareTest.cs (1)
474public ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken)
ExceptionHandlerTest.cs (8)
79Exception exception = null; 324Exception exception = null; 392Exception exception = null; 548Exception exception = null; 784Exception exception = null; 835Exception exception = null; 890Exception exception = null; 941Exception exception = null;
Microsoft.AspNetCore.Grpc.JsonTranscoding (22)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (1)
223catch (Exception ex)
Internal\Binding\JsonTranscodingServiceMethodProvider.cs (3)
56catch (Exception ex) 79catch (Exception ex) 97public static partial void ServiceDescriptorError(ILogger logger, Type serviceType, Exception ex);
Internal\CallHandlers\ServerCallHandlerBase.cs (2)
62catch (Exception ex) 73catch (Exception ex)
Internal\CommonGrpcProtocolHelpers.cs (3)
10public static string ConvertToRpcExceptionMessage(Exception ex) 17private static string BuildErrorMessage(Exception ex) 22Exception? current = ex;
Internal\ErrorMessageHelper.cs (1)
8internal static string BuildErrorMessage(string message, Exception exception, bool? includeExceptionDetails)
Internal\GrpcServerLog.cs (4)
15public static partial void ErrorExecutingServiceMethod(ILogger logger, string serviceMethod, Exception ex); 18public static partial void RpcConnectionError(ILogger logger, StatusCode statusCode, string detail, Exception? debugException); 30public static partial void ErrorReadingMessage(ILogger logger, Exception ex); 39public static partial void ErrorSendingMessage(ILogger logger, Exception ex);
Internal\JsonRequestHelpers.cs (4)
81catch (Exception ex) 112catch (Exception ex) 311catch (Exception ex) 400catch (Exception ex)
Internal\JsonTranscodingServerCallContext.cs (1)
102internal async Task ProcessHandlerErrorAsync(Exception ex, string method, bool isStreaming, JsonSerializerOptions options)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
55catch (Exception ex)
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (2)
81private static readonly Exception? s_initializationException; 172catch (Exception ex)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (6)
ConverterTests\JsonConverterReadTests.cs (4)
672private void AssertReadJsonError<TValue>(string value, Action<Exception> assertException, GrpcJsonSettings? settings = null, DescriptorRegistry? descriptorRegistry = null, bool deserializeOld = true) where TValue : IMessage, new() 682var ex = Assert.ThrowsAny<Exception>(() => JsonSerializer.Deserialize<TValue>(value, jsonSerializerOptions)); 691ex = Assert.ThrowsAny<Exception>(() => formatter.Parse<TValue>(value));
ServerStreamingServerCallHandlerTests.cs (1)
130var debugException = new Exception("Error!");
UnaryServerCallHandlerTests.cs (1)
849var debugException = new Exception("Error!");
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
55catch (Exception ex)
Microsoft.AspNetCore.HeaderParsing (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.AspNetCore.HeaderPropagation.Tests (2)
HeaderPropagationIntegrationTest.cs (2)
22Exception captured = null; 48catch (Exception ex)
Microsoft.AspNetCore.Hosting (51)
GenericHost\GenericWebHostBuilder.cs (4)
105catch (Exception ex) when (webHostOptions.CaptureStartupErrors) 129var exceptions = new List<Exception>(); 153catch (Exception ex) 258catch (Exception ex) when (webHostOptions.CaptureStartupErrors)
GenericHost\GenericWebHostService.cs (2)
145catch (Exception ex) 182foreach (var exception in Options.HostingStartupExceptions.InnerExceptions)
Internal\ApplicationLifetime.cs (3)
63catch (Exception ex) 81catch (Exception ex) 98catch (Exception ex)
Internal\ConfigureBuilder.cs (1)
44catch (Exception ex)
Internal\ErrorPageBuilder.cs (1)
18Exception exception)
Internal\HostedServiceExecutor.cs (2)
27List<Exception>? exceptions = null; 35catch (Exception ex)
Internal\HostingApplication.cs (1)
93public void DisposeContext(Context context, Exception? exception)
Internal\HostingApplicationDiagnostics.cs (4)
138public void RequestEnd(HttpContext httpContext, Exception? exception, HostingApplication.Context context) 323private void RecordUnhandledExceptionDiagnostics(HttpContext httpContext, long currentTimestamp, Exception exception) 360internal UnhandledExceptionData(HttpContext httpContext, long timestamp, Exception exception) 370public Exception exception { get; }
Internal\HostingLoggerExtensions.cs (4)
11public static void ApplicationError(this ILogger logger, Exception exception) 19public static void HostingStartupAssemblyError(this ILogger logger, Exception exception) 27public static void ApplicationError(this ILogger logger, EventId eventId, string message, Exception exception) 31foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
Internal\HostingMetrics.cs (1)
45public void RequestEnd(string protocol, string scheme, string method, string? route, int statusCode, bool unhandledRequest, Exception? exception, List<KeyValuePair<string, object?>>? customTags, long startTimestamp, long currentTimestamp, bool disableHttpRequestDurationMetric)
Internal\HostingRequestFinishedLog.cs (1)
14internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestFinishedLog)state).ToString();
Internal\HostingRequestStartingLog.cs (1)
15internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestStartingLog)state).ToString();
Internal\HostingRequestUnhandledLog.cs (1)
13internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HostingRequestUnhandledLog)state).ToString();
Internal\WebHost.cs (5)
102catch (Exception ex) 165foreach (var exception in _hostingStartupErrors.InnerExceptions) 227catch (Exception ex) 326catch (Exception ex) 361public static partial void ServerShutdownException(ILogger logger, Exception ex);
Internal\WebHostLifetime.cs (1)
76catch (Exception) { }
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
406foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
src\Shared\ErrorPage\ErrorPageModelBuilder.cs (1)
22Exception exception)
src\Shared\StackTrace\ExceptionDetails\ExceptionDetails.cs (2)
16public ExceptionDetails(Exception error, IEnumerable<StackFrameSourceCodeInfo> stackFrames) 31public Exception? Error { get; }
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (9)
29public IEnumerable<ExceptionDetails> GetDetails(Exception exception) 33foreach (var ex in exceptions) 39private IEnumerable<StackFrameSourceCodeInfo> GetStackFrames(Exception original) 55private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception? ex) 62var typeLoadExceptions = new List<Exception>(); 63foreach (var loadException in typeLoadException.LoaderExceptions) 72var list = new List<Exception>(); 76foreach (var innerException in aggregateException.Flatten().InnerExceptions)
src\Shared\StackTrace\ExceptionDetails\LoggerExtensions.cs (1)
11public static partial void FailedToReadStackTraceInfo(this ILogger logger, Exception exception);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
21public static IList<StackFrameInfo> GetFrames(Exception exception, out AggregateException? error) 41List<Exception>? exceptions = null;
WebHostBuilder.cs (3)
224var exceptions = new List<Exception>(); 246catch (Exception ex) 337catch (Exception ex)
Microsoft.AspNetCore.Hosting.Server.Abstractions (1)
IHttpApplication.cs (1)
32void DisposeContext(TContext context, Exception? exception);
Microsoft.AspNetCore.Hosting.Tests (17)
Fakes\StartupThrowTypeLoadException.cs (1)
15exceptions: new Exception[] { new FileNotFoundException("Message from the LoaderException") },
HostingApplicationDiagnosticsTests.cs (5)
1133public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1156public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 1199public void OnError(Exception error)
src\Shared\AsyncEnumerableExtensions.cs (1)
30catch (Exception ex)
StartupManagerTests.cs (2)
528Assert.Throws<Exception>(() => startup.ConfigureServicesDelegate(serviceCollection)); 543Assert.Throws<Exception>(() => startup.ConfigureDelegate(app));
WebHostBuilderTests.cs (5)
1356var stopEx = await Assert.ThrowsAnyAsync<Exception>(() => host.StopAsync()); 1382var stopEx = await Assert.ThrowsAnyAsync<Exception>(() => host.StopAsync()); 1584catch (Exception ex)
WebHostTests.cs (3)
1256catch (Exception ex) 1358public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Http (1)
Timeouts\LoggerExtensions.cs (1)
11public static partial void TimeoutExceptionHandled(this ILogger logger, Exception exception);
Microsoft.AspNetCore.Http.Abstractions (3)
BadHttpRequestException.cs (2)
38public BadHttpRequestException(string message, int statusCode, Exception innerException) 49public BadHttpRequestException(string message, Exception innerException)
ProblemDetails\ProblemDetailsContext.cs (1)
38public Exception? Exception { get; init; }
Microsoft.AspNetCore.Http.Abstractions.Tests (5)
ProblemDetailsJsonConverterTest.cs (1)
23var ex = Record.Exception(() =>
UseExtensionsTests.cs (4)
57throw await Assert.ThrowsAsync<Exception>(() => next()); 61throw await Assert.ThrowsAsync<Exception>(() => next(context)); 73var ex = await Assert.ThrowsAsync<Exception>(() => builder.Build().Invoke(context));
Microsoft.AspNetCore.Http.Connections (21)
Internal\HttpConnectionContext.cs (1)
397catch (Exception ex)
Internal\HttpConnectionDispatcher.cs (1)
249catch (Exception ex)
Internal\HttpConnectionDispatcher.Log.cs (3)
49public static partial void ConnectionDisposedWhileWriteInProgress(ILogger logger, string transportConnectionId, Exception ex); 52public static partial void FailedToReadHttpRequestBody(ILogger logger, string transportConnectionId, Exception ex); 69public static partial void NotifyOnReconnectError(ILogger logger, Exception ex);
Internal\HttpConnectionManager.cs (2)
131catch (Exception ex) 217catch (Exception ex)
Internal\HttpConnectionManager.Log.cs (3)
19public static partial void FailedDispose(ILogger logger, string transportConnectionId, Exception exception); 25public static partial void ConnectionReset(ILogger logger, string transportConnectionId, Exception exception); 28public static partial void ScanningConnectionsFailed(ILogger logger, Exception exception);
Internal\Transports\LongPollingServerTransport.cs (2)
105catch (Exception ex) 130public static partial void LongPollingTerminated(ILogger logger, Exception ex);
Internal\Transports\WebSocketsServerTransport.cs (5)
182catch (Exception ex) 202Exception? error = null; 248catch (Exception ex) 269catch (Exception ex) 283catch (Exception ex)
Internal\Transports\WebSocketsServerTransport.Log.cs (4)
47public static partial void ErrorWritingFrame(ILogger logger, Exception ex); 50public static partial void ClosedPrematurely(ILogger logger, Exception ex); 53public static partial void ClosingWebSocketFailed(ILogger logger, Exception ex); 56public static partial void SendErrored(ILogger logger, Exception exception);
Microsoft.AspNetCore.Http.Connections.Client (38)
HttpConnection.cs (6)
278catch (Exception ex) 310var transportExceptions = new List<Exception>(); 419catch (Exception ex) 501catch (Exception ex) 529catch (Exception ex) 579catch (Exception ex) when (ex is NotSupportedException || ex is NotImplementedException)
HttpConnection.Log.cs (5)
51public static partial void ErrorWithNegotiation(ILogger logger, Uri url, Exception exception); 54public static partial void ErrorStartingTransport(ILogger logger, HttpTransportType transport, Exception exception); 83public static void TransportFailed(ILogger logger, HttpTransportType transport, Exception ex) 92public static partial void TransportFailed(ILogger logger, string transportName, Exception ex); 98public static partial void TransportThrewExceptionOnStop(ILogger logger, Exception ex);
Internal\DefaultTransportFactory.cs (1)
67public static partial void TransportNotSupported(ILogger logger, HttpTransportType transportType, Exception ex);
Internal\LongPollingTransport.cs (4)
26private volatile Exception? _error; 129catch (Exception ex) 214catch (Exception ex) 248catch (Exception ex)
Internal\LongPollingTransport.Log.cs (3)
20public static partial void TransportStopped(ILogger logger, Exception? exception); 41public static partial void ErrorPolling(ILogger logger, Uri pollUrl, Exception exception); 63public static partial void ErrorSendingDeleteRequest(ILogger logger, Uri pollUrl, Exception ex);
Internal\SendUtils.cs (2)
77catch (Exception ex) 135public static partial void ErrorSending(ILogger logger, Uri url, Exception exception);
Internal\ServerSentEventsTransport.cs (3)
25private volatile Exception? _error; 161catch (Exception ex) 193catch (Exception ex)
Internal\ServerSentEventsTransport.Log.cs (1)
20public static partial void TransportStopped(ILogger logger, Exception? exception);
Internal\WebSocketsTransport.cs (7)
413catch (Exception ex) 503catch (Exception ex) 534Exception? error = null; 569catch (Exception ex) 589catch (Exception ex) 611catch (Exception ex) 679catch (Exception ex)
Internal\WebSocketsTransport.Log.cs (5)
19public static partial void TransportStopped(ILogger logger, Exception? exception); 58public static partial void ErrorSendingMessage(ILogger logger, Exception exception); 64public static partial void ClosingWebSocketFailed(ILogger logger, Exception exception); 77public static partial void ReceiveErrored(ILogger logger, Exception exception); 80public static partial void SendErrored(ILogger logger, Exception exception);
TransportFailedException.cs (1)
24public TransportFailedException(string transportType, string message, Exception? innerException = null)
Microsoft.AspNetCore.Http.Connections.Common (1)
NegotiateProtocol.cs (1)
267catch (Exception ex)
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionManagerTests.cs (1)
123catch (Exception ex) when (!(ex is TimeoutException))
WebSocketsTests.cs (1)
135catch (Exception ex)
Microsoft.AspNetCore.Http.Extensions (16)
HttpRequestJsonExtensions.cs (1)
340catch (Exception ex)
RequestDelegateFactory.cs (7)
2650public static void InvalidJsonRequestBody(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2662private static partial void InvalidJsonRequestBody(ILogger logger, string parameterType, string parameterName, Exception exception); 2734public static void InvalidFormRequestBody(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2746private static partial void InvalidFormRequestBody(ILogger logger, string parameterType, string parameterName, Exception exception); 2748public static void InvalidAntiforgeryToken(HttpContext httpContext, string parameterTypeName, string parameterName, Exception exception, bool shouldThrow) 2760private static partial void InvalidAntiforgeryToken(ILogger logger, string parameterType, string parameterName, Exception exception); 2774private static partial void FormDataMappingFailed(ILogger logger, string parameterType, string parameterName, Exception exception);
src\Components\Endpoints\src\FormMapping\Converters\CollectionConverter.cs (1)
243catch (Exception ex)
src\Components\Endpoints\src\FormMapping\Converters\CompiledComplexTypeConverter.cs (1)
23catch (Exception ex)
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (2)
39var exceptionVar = Expression.Variable(typeof(Exception), "mappingException"); 145var exception = Expression.Variable(typeof(Exception), "constructorException");
src\Components\Endpoints\src\FormMapping\FormDataMapper.cs (2)
27catch (Exception ex) 46public static partial void CannotResolveConverter(ILogger logger, Type type, Exception? ex);
src\Components\Endpoints\src\FormMapping\FormDataMappingException.cs (1)
10public FormDataMappingException(FormDataMappingError error, Exception? innerException)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
83public void AddMappingError(Exception exception, string? attemptedValue)
Microsoft.AspNetCore.Http.Extensions.Tests (5)
RequestDelegateFactoryTests.cs (3)
3251var exception = Record.Exception(() => RequestDelegateFactory.Create(@delegate)); 3633private readonly Exception _exceptionToThrow; 3635public ExceptionThrowingRequestBodyStream(Exception exceptionToThrow)
RequestDelegateGenerator\SharedTypes.cs (2)
480public readonly Exception _exceptionToThrow; 482public ExceptionThrowingRequestBodyStream(Exception exceptionToThrow)
Microsoft.AspNetCore.Http.Features (3)
IAntiforgeryValidationFeature.cs (2)
17/// Gets the <see cref="Exception"/> that occurred when validating the anti-forgery token. 19Exception? Error { get; }
IBadRequestExceptionFeature.cs (1)
14Exception? Error { get; }
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (2)
480public readonly Exception _exceptionToThrow; 482public ExceptionThrowingRequestBodyStream(Exception exceptionToThrow)
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsOfTTests.cs (1)
79catch (Exception)
Microsoft.AspNetCore.Http.Tests (4)
HttpContextAccessorTests.cs (4)
57catch (Exception ex) 102catch (Exception ex) 141catch (Exception ex) 168catch (Exception ex)
Microsoft.AspNetCore.HttpLogging (8)
BufferingStream.cs (1)
219private static Exception CreateArgumentOutOfRangeException(string argumentName) { return new ArgumentOutOfRangeException(argumentName); }
FileLoggerProcessor.cs (4)
133catch (Exception ex) 250catch (Exception ex) 342public static partial void WriteMessagesFailed(ILogger logger, Exception ex); 345public static partial void CreateDirectoryFailed(ILogger logger, string path, Exception ex);
HttpLog.cs (1)
15internal static readonly Func<object, Exception?, string> Callback = (state, exception) => ((HttpLog)state).ToString();
HttpLoggingExtensions.cs (1)
30public static partial void DecodeFailure(this ILogger logger, Exception ex);
HttpLoggingMiddleware.cs (1)
100catch (Exception)
Microsoft.AspNetCore.HttpLogging.Tests (1)
HttpLoggingServicesExtensionsTests.cs (1)
62var exception = await Record.ExceptionAsync(() => app.Invoke(context));
Microsoft.AspNetCore.HttpOverrides (2)
CertificateForwardingFeature.cs (1)
41catch (Exception e)
LoggingExtensions.cs (1)
9public static partial void NoCertificate(this ILogger logger, Exception exception);
Microsoft.AspNetCore.Identity.Specification.Tests (2)
TestLogger.cs (2)
60public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Identity.Test (2)
RetryHandler.cs (1)
47catch (Exception e)
UserManagerTest.cs (1)
968private async Task VerifyException<TException>(Func<Task> code, string expectedMessage) where TException : Exception
Microsoft.AspNetCore.InternalTesting (24)
CollectDumpAttribute.cs (1)
26public Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken)
ExceptionAssertions.cs (10)
21where TException : Exception 35where TException : Exception 51where TException : Exception 70where TException : Exception 223private static Exception RecordException(Action testCode) 233catch (Exception exception) 239private static Exception UnwrapException(Exception exception) 244private static TException VerifyException<TException>(Exception exception) 254private static void VerifyExceptionMessage(Exception exception, string expectedMessage, bool partialMatch = false)
ITestMethodLifecycle.cs (1)
21Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken);
LoggedTest\LoggedTestBase.cs (2)
89catch (Exception e) 123Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken)
Logging\TestLogger.cs (2)
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Logging\TestLoggerT.cs (2)
31Exception exception, 32Func<TState, Exception, string> formatter)
Logging\WriteContext.cs (2)
16public Exception Exception { get; set; } 18public Func<object, Exception, string> Formatter { get; set; }
Logging\XunitLoggerProvider.cs (3)
62LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 107catch (Exception)
xunit\AspNetTestInvoker.cs (1)
52var exception = Aggregator.HasExceptions ? Aggregator.ToException() : null;
Microsoft.AspNetCore.InternalTesting.Tests (5)
TestContextTest.cs (3)
27Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 52Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 78Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken)
TestPathUtilitiesTest.cs (2)
18var exception = Assert.Throws<Exception>(() => TestPathUtilities.GetSolutionRootDirectory("NotTesting"));
Microsoft.AspNetCore.JsonPatch (4)
Converters\JsonPatchDocumentConverter.cs (1)
59catch (Exception ex)
Converters\TypedJsonPatchDocumentConverter.cs (1)
56catch (Exception ex)
Exceptions\JsonPatchException.cs (2)
18public JsonPatchException(JsonPatchError jsonPatchError, Exception innerException) 30public JsonPatchException(string message, Exception innerException)
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisMiddleware.cs (1)
79catch (Exception ex)
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
TestDiagnosticListener.cs (1)
22public virtual void OnMiddlewareException(Exception exception, string name)
Microsoft.AspNetCore.Mvc.Abstractions (39)
Filters\ActionExecutedContext.cs (4)
13private Exception? _exception; 42/// Gets or sets the <see cref="System.Exception"/> caught while executing the action or action filters, if 45public virtual Exception? Exception 68/// <see cref="Exception"/>, if an <see cref="System.Exception"/> was caught and this information captured.
Filters\ExceptionContext.cs (3)
14private Exception? _exception; 28/// Gets or sets the <see cref="System.Exception"/> caught while executing the action. 30public virtual Exception Exception
Filters\IAsyncExceptionFilter.cs (2)
7/// A filter that runs asynchronously after an action has thrown an <see cref="System.Exception"/>. 12/// Called after an action has thrown an <see cref="System.Exception"/>.
Filters\IExceptionFilter.cs (2)
7/// A filter that runs after an action has thrown an <see cref="System.Exception"/>. 12/// Called after an action has thrown an <see cref="System.Exception"/>.
Filters\ResourceExecutedContext.cs (2)
13private Exception? _exception; 45public virtual Exception? Exception
Filters\ResultExecutedContext.cs (4)
13private Exception? _exception; 50/// Gets or sets the <see cref="System.Exception"/> caught while executing the result or result filters, if 53public virtual Exception? Exception 76/// <see cref="Exception"/>, if an <see cref="System.Exception"/> was caught and this information captured.
Formatters\InputFormatterException.cs (1)
33public InputFormatterException(string message, Exception innerException)
ModelBinding\ModelError.cs (6)
14/// <param name="exception">The <see cref="System.Exception"/>.</param> 15public ModelError(Exception exception) 24/// <param name="exception">The <see cref="System.Exception"/>.</param> 26public ModelError(Exception exception, string? errorMessage) 42/// Gets the <see cref="System.Exception"/> associated with this <see cref="ModelError"/> instance. 44public Exception? Exception { get; }
ModelBinding\ModelErrorCollection.cs (2)
16/// <param name="exception">The <see cref="Exception"/></param> 17public void Add(Exception exception)
ModelBinding\ModelMetadata.cs (1)
48private Exception? _recordTypeValidatorsOnPropertiesError;
ModelBinding\ModelStateDictionary.cs (10)
97/// <see cref="AddModelError(string, Exception, ModelMetadata)"/> or 98/// <see cref="TryAddModelError(string, Exception, ModelMetadata)"/>. 199/// Where <see cref="ModelMetadata"/> is available, use <see cref="AddModelError(string, Exception, ModelMetadata)"/> instead. 202/// <param name="exception">The <see cref="Exception"/> to add.</param> 207public bool TryAddModelException(string key, Exception exception) 236/// <param name="exception">The <see cref="Exception"/> to add. Some exception types will be replaced with 239public void AddModelError(string key, Exception exception, ModelMetadata metadata) 255/// <param name="exception">The <see cref="Exception"/> to add. Some exception types will be replaced with 262public bool TryAddModelError(string key, Exception exception, ModelMetadata metadata) 677private void AddModelErrorCore(string key, Exception exception)
ModelBinding\TooManyModelErrorsException.cs (1)
7/// The <see cref="Exception"/> that is thrown when too many model errors are encountered.
ModelBinding\ValueProviderException.cs (1)
26public ValueProviderException(string message, Exception innerException)
Microsoft.AspNetCore.Mvc.Abstractions.Test (2)
ModelBinding\ModelStateDictionaryTest.cs (2)
325var exception = new Exception(); 649var ex = new Exception();
Microsoft.AspNetCore.Mvc.Core (48)
Filters\ExceptionFilterAttribute.cs (1)
7/// An abstract filter that runs asynchronously after an action has thrown an <see cref="Exception"/>. Subclasses
Filters\MiddlewareFilterConfigurationProvider.cs (1)
108catch (Exception ex)
Formatters\SystemTextJsonInputFormatter.cs (4)
72var modelStateException = WrapExceptionForModelState(jsonException); 80catch (Exception exception) when (exception is FormatException || exception is OverflowException) 113private Exception WrapExceptionForModelState(JsonException jsonException) 142public static void JsonInputException(ILogger logger, Exception exception)
Formatters\SystemTextJsonOutputFormatter.cs (1)
123catch (Exception ex)
Infrastructure\ControllerActionInvoker.cs (3)
306catch (Exception exception) 328catch (Exception exception) 474catch (Exception ex)
Infrastructure\ResourceInvoker.cs (17)
72catch (Exception exception) 144Exception? releaseException = null; 154catch (Exception exception) 163Exception? releaseException = null; 168catch (Exception exception) 176static ValueTask HandleReleaseErrors(IDisposable? scope, Exception? releaseException) 178Exception? scopeException = null; 183catch (Exception exception) 241catch (Exception ex) 963catch (Exception exception) 985catch (Exception exception) 1017catch (Exception ex) 1035catch (Exception exception) 1065catch (Exception ex) 1103catch (Exception ex) 1365catch (Exception exception) 1388catch (Exception exception)
Infrastructure\SystemTextJsonResultExecutor.cs (1)
87catch (Exception ex)
ModelBinding\Binders\BodyModelBinder.cs (1)
183catch (Exception exception) when (exception is InputFormatterException || ShouldHandleException(formatter))
ModelBinding\Binders\ByteArrayModelBinder.cs (1)
60catch (Exception exception)
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
165catch (Exception ex) 708catch (Exception exception) 715Exception exception,
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
546catch (Exception exception) 553Exception exception,
ModelBinding\Binders\DateTimeModelBinder.cs (1)
89catch (Exception exception)
ModelBinding\Binders\DecimalModelBinder.cs (1)
92catch (Exception exception)
ModelBinding\Binders\DictionaryModelBinder.cs (1)
171catch (Exception ex)
ModelBinding\Binders\DoubleModelBinder.cs (1)
92catch (Exception exception)
ModelBinding\Binders\FloatModelBinder.cs (1)
92catch (Exception exception)
ModelBinding\Binders\SimpleTypeModelBinder.cs (1)
87catch (Exception exception)
ModelBinding\Binders\TryParseModelBinder.cs (2)
88catch (Exception exception) 98private static void AddModelError(ModelBindingContext bindingContext, Exception exception)
ModelBinding\ModelBindingHelper.cs (1)
728catch (Exception ex)
ModelBinding\UnsupportedContentTypeException.cs (1)
9/// The <see cref="Exception"/> that is added to model state when a model binder for the body of the request is
Routing\AttributeRoute.cs (1)
201catch (Exception ex)
Routing\ConventionalRouteEntry.cs (1)
42catch (Exception exception)
src\Shared\MediaType\ReadOnlyMediaTypeHeaderValue.cs (1)
363catch (Exception)
Microsoft.AspNetCore.Mvc.Core.Test (20)
Filters\MiddlewareFilterBuilderTest.cs (3)
179Exception thrownException; 185catch (Exception ex) 253catch (Exception ex)
Infrastructure\ControllerActionInvokerTest.cs (1)
1601Exception exception = null,
Infrastructure\JsonResultExecutorTestBase.cs (1)
221catch (Exception serializerException)
ModelBinding\FormFileValueProviderFactoryTest.cs (1)
102private static ValueProviderFactoryContext CreateThrowingContext(Exception exception)
ModelBinding\FormValueProviderFactoryTest.cs (1)
90private static ValueProviderFactoryContext CreateThrowingContext(Exception exception)
ModelBinding\JQueryFormValueProviderFactoryTest.cs (1)
175private static ValueProviderFactoryContext CreateThrowingContext(Exception exception)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (12)
83var key = ModelMetadataIdentity.ForType(typeof(Exception)); 90Assert.Equal(typeof(Exception), metadata.ModelType); 102var key = ModelMetadataIdentity.ForProperty(typeof(Exception).GetProperty(nameof(Exception.Message)), typeof(string), typeof(Exception)); 111Assert.Equal(typeof(Exception), metadata.ContainerType); 463var prop1 = typeof(Exception).GetProperty(nameof(Exception.Message)); 464var prop2 = typeof(Exception).GetProperty(nameof(Exception.StackTrace)); 975.Setup(mp => mp.GetMetadataForProperties(typeof(Exception))) 980var metadata2 = metadata1.GetMetadataForProperties(typeof(Exception));
Microsoft.AspNetCore.Mvc.Core.TestCommon (5)
CommonResourceInvokerTest.cs (5)
18protected static readonly Exception Exception = new DivideByZeroException(); 22Exception exception = null, 31Exception exception = null, 78Exception exception = null; 120Exception exception = null;
Microsoft.AspNetCore.Mvc.Formatters.Xml (6)
XmlDataContractSerializerInputFormatter.cs (1)
223catch (Exception)
XmlDataContractSerializerOutputFormatter.cs (2)
158catch (Exception ex) 321public static partial void FailedToCreateDataContractSerializer(ILogger logger, string type, Exception exception);
XmlSerializerInputFormatter.cs (1)
228catch (Exception)
XmlSerializerOutputFormatter.cs (2)
137catch (Exception ex) 310public static partial void FailedToCreateXmlSerializer(ILogger logger, string type, Exception exception);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (4)
XmlDataContractSerializerInputFormatterTest.cs (2)
494var ex = await Assert.ThrowsAsync(expectedException, () => formatter.ReadAsync(context)); 523var ex = await Assert.ThrowsAsync(expectedException, () => formatter.ReadAsync(context));
XmlSerializerInputFormatterTest.cs (2)
514var ex = await Assert.ThrowsAsync(expectedException, () => formatter.ReadAsync(context)); 544var ex = await Assert.ThrowsAsync(expectedException, () => formatter.ReadAsync(context));
Microsoft.AspNetCore.Mvc.NewtonsoftJson (5)
NewtonsoftJsonInputFormatter.cs (5)
141Exception? exception = null; 308var modelStateException = WrapExceptionForModelState(exception); 414private Exception WrapExceptionForModelState(Exception exception) 441public static partial void JsonInputException(ILogger logger, Exception exception);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
221catch (Exception serializerException)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
181catch (Exception ex)
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageTest.cs (1)
440Exception ex = null;
Microsoft.AspNetCore.Mvc.RazorPages (5)
Filters\PageHandlerExecutedContext.cs (4)
17private Exception? _exception; 62/// Gets or sets the <see cref="System.Exception"/> caught while executing the action or action filters, if 65public virtual Exception? Exception 88/// <see cref="Exception"/>, if an <see cref="System.Exception"/> was caught and this information captured.
Infrastructure\PageActionInvoker.cs (1)
662catch (Exception exception)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageActionInvokerTest.cs (1)
1439Exception exception = null,
Microsoft.AspNetCore.Mvc.TagHelpers (3)
Cache\DistributedCacheTagHelperService.cs (2)
125catch (Exception e) 205public static partial void DistributedFormatterDeserializationException(ILogger logger, string key, Exception exception);
CacheTagHelper.cs (1)
135catch (Exception ex)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
CacheTagHelperTest.cs (3)
678await Assert.ThrowsAsync<Exception>(() => cacheTagHelper1.ProcessAsync(tagHelperContext1, tagHelperOutput1)); 751await Assert.ThrowsAsync<Exception>(() => cacheTagHelper.ProcessAsync(tagHelperContext1, tagHelperOutput1)); 763await Assert.ThrowsAsync<Exception>(() => cacheTagHelper.ProcessAsync(tagHelperContext2, tagHelperOutput2));
DistributedCacheTagHelperTest.cs (1)
690await Assert.ThrowsAsync<Exception>(() => cacheTagHelper1.ProcessAsync(tagHelperContext1, tagHelperOutput1));
TagHelperLogger.cs (2)
22public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Mvc.Testing (9)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (7)
66Action<Exception?>? entrypointCompleted = null) 206private readonly Action<Exception?>? _entrypointCompleted; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted) 227Exception? exception = null; 260catch (Exception ex) 304public void OnError(Exception error) 356throw (Exception)Activator.CreateInstance(publicHostAbortedExceptionType)!;
DeferredHostBuilder.cs (1)
100public void EntryPointCompleted(Exception? exception)
WebApplicationFactory.cs (1)
359catch (Exception)
Microsoft.AspNetCore.Mvc.ViewFeatures (9)
CookieTempDataProvider.cs (2)
80catch (Exception ex) 148public static partial void TempDataCookieLoadFailure(ILogger logger, string cookieName, Exception exception);
DefaultHtmlGenerator.cs (1)
1389catch (Exception exception)
Filters\AntiforgeryMiddlewareAuthorizationFilter.cs (1)
35public static partial void AntiforgeryTokenInvalid(ILogger logger, string message, Exception exception);
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (1)
57public static partial void AntiforgeryTokenInvalid(ILogger logger, string message, Exception exception);
ModelStateDictionaryExtensions.cs (4)
51/// <param name="exception">The <see cref="Exception"/> to add.</param> 55Exception exception) 72/// <param name="exception">The <see cref="Exception"/> to add.</param> 77Exception exception,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (12)
Filters\AntiforgeryMiddlewareAuthorizationFilterTest.cs (1)
87public Exception Error { get; } = exception;
ModelStateDictionaryExtensionsTest.cs (8)
82var exception = new Exception(); 100var exception = new Exception(); 120var exception = new Exception(); 138var exception = new Exception(); 158var exception = new Exception(); 176var exception = new Exception(); 197var exception = new Exception(); 216var exception = new Exception();
ViewComponents\ViewViewComponentResultTest.cs (1)
291var actual = Record.Exception(() => result.Execute(viewComponentContext));
ViewDataOfTTest.cs (2)
18Exception ex = Assert.Throws<InvalidOperationException>(() => viewData.Model = null); 30Exception ex = Assert.Throws<InvalidOperationException>(() => viewData.Model = DateTime.UtcNow);
Microsoft.AspNetCore.OutputCaching (6)
DispatcherExtensions.cs (2)
34catch (Exception ex) 73catch (Exception ex)
LoggerExtensions.cs (2)
53internal static partial void UnableToQueryOutputCache(this ILogger logger, Exception exception); 56internal static partial void UnableToWriteToOutputCache(this ILogger logger, Exception exception);
OutputCacheEntryFormatter.cs (1)
66catch (Exception ex)
OutputCacheMiddleware.cs (1)
353catch (Exception ex)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (2)
EndToEndBenchmarks.cs (2)
281public override void Complete(Exception? exception = null) { } 283public override ValueTask CompleteAsync(Exception? exception = null) => default;
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (10)
RedisOutputCacheStore.cs (7)
112catch (Exception ex) 119catch (Exception ex) 199catch (Exception ex) 229catch (Exception ex) 366private void OnRedisError(Exception exception, IDatabase cache) 462catch (Exception ex) 495catch (Exception ex)
RedisOutputCacheStore.Log.cs (3)
13internal static partial void RedisOutputCacheGCTransientFault(ILogger logger, Exception exception); 16internal static partial void RedisOutputCacheGCFatalError(ILogger logger, Exception exception); 19internal static partial void UnableToAddLibraryNameSuffix(ILogger logger, Exception exception);
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheTests.cs (1)
1026catch (Exception ex)
Microsoft.AspNetCore.Owin (1)
WebSockets\OwinWebSocketAcceptAdapter.cs (1)
131catch (Exception ex)
Microsoft.AspNetCore.RateLimiting (7)
DefaultCombinedLease.cs (5)
62List<Exception>? exceptions = null; 71catch (Exception ex) 73exceptions ??= new List<Exception>(); 81catch (Exception ex) 83exceptions ??= new List<Exception>(1);
RateLimitingMiddleware.cs (2)
201catch (Exception) 232catch (Exception ex)
Microsoft.AspNetCore.RateLimiting.Tests (1)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
78var exception = await Record.ExceptionAsync(() => app.Invoke(context));
Microsoft.AspNetCore.Razor.Runtime.Test (2)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (2)
32await Assert.ThrowsAsync<Exception>(async () => await executionContext.SetOutputContentAsync()); 55await Assert.ThrowsAsync<Exception>(
Microsoft.AspNetCore.RequestDecompression.Tests (7)
RequestDecompressionMiddlewareTests.cs (3)
344Exception exception = null; 439Exception exception = null; 525Exception exception = null;
SizeLimitedStreamTests.cs (4)
36var exception = await Record.ExceptionAsync(async () => 60var exception = Record.Exception(() => 84var exception = Record.Exception(() => 94private static void AssertStreamReadingException(Exception exception, bool exceedsLimit)
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\InvalidUrlRewriteFormatException.cs (1)
19public InvalidUrlRewriteFormatException(XElement element, string message, Exception innerException)
Microsoft.AspNetCore.Routing (5)
EndpointRoutingMiddleware.cs (1)
272catch (Exception ex)
ParameterPolicyActivator.cs (1)
61catch (Exception exception)
RouteBase.cs (1)
58catch (Exception exception)
RouteCreationException.cs (1)
30public RouteCreationException(string message, Exception innerException)
src\Shared\MediaType\ReadOnlyMediaTypeHeaderValue.cs (1)
363catch (Exception)
Microsoft.AspNetCore.Routing.FunctionalTests (1)
MinimalFormTests.cs (1)
220Exception exception = null;
Microsoft.AspNetCore.Routing.Tests (14)
CompositeEndpointDataSourceTest.cs (7)
64var ex = new Exception(); 77Assert.Same(ex, Assert.Throws<Exception>(() => compositeDataSource.Endpoints)); 78Assert.Same(ex, Assert.Throws<Exception>(() => compositeDataSource.Endpoints)); 79Assert.Same(ex, Assert.Throws<Exception>(() => compositeDataSource.GetGroupedEndpoints(groupContext))); 80Assert.Same(ex, Assert.Throws<Exception>(() => compositeDataSource.GetGroupedEndpoints(groupContext))); 531private readonly Exception _ex; 533public EndpointThrowingDataSource(Exception ex)
EndpointRoutingMiddlewareTest.cs (1)
502public void OnError(Exception error)
Logging\WriteContext.cs (2)
16public Exception Exception { get; set; } 18public Func<object, Exception, string> Formatter { get; set; }
RoutingServiceCollectionExtensionsTests.cs (3)
19var ex = Record.Exception(() => 33var ex = Record.Exception(() => 45var ex = Record.Exception(() =>
Tree\TreeRouterTest.cs (1)
1842await Assert.ThrowsAsync<Exception>(() => route.RouteAsync(context));
Microsoft.AspNetCore.Server.HttpSys (78)
AsyncAcceptContext.cs (3)
85catch (Exception ex) 108catch (Exception exception) 114catch (Exception ex)
AsyncAcceptContext.Log.cs (1)
13public static partial void AcceptSetResultFailed(ILogger logger, Exception exception);
HttpSysListener.cs (5)
81catch (Exception exception) 167catch (Exception exception) 203catch (Exception exception) 238catch (Exception exception) 298catch (Exception ex)
HttpSysListener.Log.cs (5)
13public static partial void ListenerDisposeError(ILogger logger, Exception exception); 19public static partial void HttpSysListenerCtorError(ILogger logger, Exception exception); 22public static partial void ListenerStartError(ILogger logger, Exception exception); 28public static partial void ListenerStopError(ILogger logger, Exception exception); 34public static partial void RequestValidationFailed(ILogger logger, Exception exception, ulong requestId);
MessagePump.cs (4)
206catch (Exception ex) 268catch (Exception ex) 288catch (Exception ex) 305catch (Exception ex)
MessagePump.Log.cs (3)
15public static partial void AcceptError(ILogger logger, Exception exception); 18public static partial void AcceptErrorStopping(ILogger logger, Exception exception); 52public static partial void RequestListenerProcessError(ILogger logger, Exception exception);
NativeInterop\DisconnectListener.Log.cs (4)
13public static partial void DisconnectHandlerError(ILogger logger, Exception exception); 16public static partial void DisconnectRegistrationError(ILogger logger, Exception exception); 19public static partial void CreateDisconnectTokenError(ILogger logger, Exception exception); 28public static partial void UnknownDisconnectError(ILogger logger, Exception exception);
NativeInterop\UrlGroup.Log.cs (1)
19public static partial void SetUrlPropertyError(ILogger logger, Exception exception);
RequestProcessing\ClientCertLoader.cs (4)
30private Exception? _clientCertException; 67internal Exception? ClientCertException 210private void Fail(Exception ex) 296catch (Exception exception)
RequestProcessing\ClientCertLoader.Log.cs (1)
13public static partial void ChannelBindingMissing(ILogger logger, Exception exception);
RequestProcessing\Request.cs (2)
429catch (Exception) 502public static partial void ErrorInReadingCertificate(ILogger logger, Exception exception);
RequestProcessing\RequestContext.cs (1)
164catch (Exception ex)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
113catch (Exception ex)
RequestProcessing\RequestContext.Log.cs (2)
13public static partial void AbortError(ILogger logger, Exception exception); 22public static partial void RequestParsingError(ILogger logger, Exception exception);
RequestProcessing\RequestContextLog.cs (2)
11public static partial void RequestError(ILogger logger, Exception exception); 14public static partial void RequestProcessError(ILogger logger, Exception exception);
RequestProcessing\RequestContextOfT.cs (3)
44Exception? applicationException = null; 59catch (Exception ex) 124catch (Exception ex)
RequestProcessing\RequestStream.cs (9)
158Exception exception = new IOException(string.Empty, new HttpSysException((int)statusCode)); 165if (TryCheckSizeLimit((int)dataRead, out var ex)) 213if (TryCheckSizeLimit((int)dataRead, out var exception)) 255catch (Exception e) 270if (TryCheckSizeLimit((int)totalRead, out var exception)) 279Exception exception = new IOException(string.Empty, new HttpSysException((int)statusCode)); 292if (TryCheckSizeLimit((int)totalRead, out var exception)) 333else if (TryCheckSizeLimit(0, out var exception)) 340internal bool TryCheckSizeLimit(int bytesRead, [NotNullWhen(true)] out Exception? exception)
RequestProcessing\RequestStream.Log.cs (3)
13public static partial void ErrorWhenReadAsync(ILogger logger, Exception exception); 16public static partial void ErrorWhenReadBegun(ILogger logger, Exception exception); 19public static partial void ErrorWhileRead(ILogger logger, Exception exception);
RequestProcessing\RequestStreamAsyncResult.cs (5)
87catch (Exception e) 101if (_requestStream.TryCheckSizeLimit(read + (int)DataAlreadyRead, out var exception)) 114catch (Exception) 123internal void Fail(Exception ex) 134catch (Exception)
RequestProcessing\ResponseBody.cs (5)
370catch (Exception e) 392Exception exception = new IOException(string.Empty, new HttpSysException((int)statusCode)); 693catch (Exception e) 796public static partial void ErrorWhenFlushAsync(ILogger logger, Exception exception); 802public static partial void FileSendAsyncError(ILogger logger, Exception exception);
RequestProcessing\ResponseStreamAsyncResult.cs (2)
272catch (Exception e) 306internal void Fail(Exception ex)
RequestProcessing\ResponseStreamAsyncResult.Log.cs (1)
16public static partial void WriteError(ILogger logger, Exception exception);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
ValidationHelper.cs (2)
10public static string ExceptionMessage(Exception exception) 33else if (objectValue is Exception ex)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (55)
DummyApplication.cs (1)
28public void DisposeContext(HttpContext httpContext, Exception exception)
Http2Tests.cs (7)
667catch (Exception ex) 710catch (Exception ex) 757catch (Exception ex) 809catch (Exception ex) 863catch (Exception ex) 911catch (Exception ex) 961catch (Exception ex)
Http3Tests.cs (6)
33catch (Exception ex) 61catch (Exception ex) 101catch (Exception ex) 137catch (Exception ex) 165catch (Exception ex) 195catch (Exception ex)
HttpsTests.cs (3)
139catch (Exception ex) 231catch (Exception ex) 261catch (Exception ex)
OpaqueUpgradeTests.cs (8)
32catch (Exception ex) 59catch (Exception ex) 230catch (Exception ex) 266catch (Exception ex) 289catch (Exception ex) 319catch (Exception ex) 361catch (Exception) 399catch (Exception)
RequestBodyTests.cs (1)
326catch (Exception)
RequestTests.cs (5)
56catch (Exception ex) 120catch (Exception ex) 183catch (Exception ex) 227catch (Exception ex) 324catch (Exception ex)
ResponseBodyTests.cs (2)
294catch (Exception) 421catch (Exception ex)
ResponseCachingTests.cs (2)
453catch (Exception ex) 461catch (Exception ex)
ResponseSendFileTests.cs (9)
48catch (Exception) 383catch (Exception ex) 411catch (Exception ex) 440catch (Exception ex) 467catch (Exception ex) 511catch (Exception ex) 554catch (Exception ex) 606catch (Exception ex) 655catch (Exception ex)
ResponseTests.cs (1)
245catch (Exception ex)
ResponseTrailersTests.cs (1)
131catch (Exception ex)
ServerTests.cs (1)
672catch (Exception)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
116catch (Exception ex)
src\Shared\Http2cat\Http2Utilities.cs (3)
894return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR); 942where TException : Exception 949where TException : Exception
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
src\Shared\TransportTestHelpers\HttpSysHttp3SupportedAttribute.cs (1)
33catch (Exception)
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DummyApplication.cs (1)
26public void DisposeContext(HttpContext httpContext, Exception exception)
Microsoft.AspNetCore.Server.IIS (57)
Core\EmptyStream.cs (2)
13private Exception? _error; 54public void Abort(Exception? error = null)
Core\HttpRequestStream.cs (2)
16private Exception? _error; 102public void Abort(Exception? error = null)
Core\IISHttpContext.cs (5)
51protected Exception? _applicationException; 719catch (Exception ex) 742catch (Exception ex) 767protected void ReportApplicationError(Exception ex) 873catch (Exception ex)
Core\IISHttpContext.IO.cs (6)
98Exception? error = null; 144catch (Exception ex) 157Exception? error = null; 215catch (Exception ex) 281catch (Exception ex) 288public void Abort(Exception reason)
Core\IISHttpContext.Log.cs (2)
17public static partial void ApplicationError(ILogger logger, string connectionId, string traceIdentifier, Exception ex); 20public static partial void UnexpectedError(ILogger logger, string className, Exception ex, [CallerMemberName] string? methodName = null);
Core\IISHttpContextOfT.cs (3)
45catch (Exception ex) 117catch (Exception ex) 135catch (Exception ex)
Core\IISHttpServer.cs (5)
170catch (Exception ex) 195catch (Exception ex) 218catch (Exception ex) 241catch (Exception ex) 267catch (Exception ex)
Core\IO\AsyncIOOperation.cs (3)
19private Exception? _exception; 60var exception = _exception; 72var exception = _exception;
Core\Streams.cs (1)
57public void Abort(Exception error)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
406foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
src\Shared\ErrorPage\ErrorPageModelBuilder.cs (1)
22Exception exception)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
src\Shared\StackTrace\ExceptionDetails\ExceptionDetails.cs (2)
16public ExceptionDetails(Exception error, IEnumerable<StackFrameSourceCodeInfo> stackFrames) 31public Exception? Error { get; }
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (9)
29public IEnumerable<ExceptionDetails> GetDetails(Exception exception) 33foreach (var ex in exceptions) 39private IEnumerable<StackFrameSourceCodeInfo> GetStackFrames(Exception original) 55private static IEnumerable<Exception> FlattenAndReverseExceptionTree(Exception? ex) 62var typeLoadExceptions = new List<Exception>(); 63foreach (var loadException in typeLoadException.LoaderExceptions) 72var list = new List<Exception>(); 76foreach (var innerException in aggregateException.Flatten().InnerExceptions)
src\Shared\StackTrace\ExceptionDetails\LoggerExtensions.cs (1)
11public static partial void FailedToReadStackTraceInfo(this ILogger logger, Exception exception);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
21public static IList<StackFrameInfo> GetFrames(Exception exception, out AggregateException? error) 41List<Exception>? exceptions = null;
StartupHook.cs (2)
46var exception = (Exception)eventArgs.ExceptionObject;
Microsoft.AspNetCore.Server.IISIntegration (1)
ForwardedTlsConnectionFeature.cs (1)
34catch (Exception ex)
Microsoft.AspNetCore.Server.IntegrationTesting (10)
Common\LoggingHandler.cs (1)
27catch (Exception ex)
Common\RetryHelper.cs (3)
47catch (Exception exception) 71Action<Exception> exceptionBlock, 82catch (Exception exception)
Deployers\ApplicationDeployer.cs (2)
156catch (Exception exception) 171catch (Exception)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (3)
124catch (Exception ex) 134catch (Exception ex) 144catch (Exception ex)
Deployers\SelfHostDeployer.cs (1)
179catch (Exception ex)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (5)
IISDeployer.cs (3)
471List<Exception> exceptions = null; 487catch (Exception ex) 491exceptions = new List<Exception>();
IISExpressDeployer.cs (1)
421catch (Exception exception)
RetryHandler.cs (1)
35catch (Exception ex)
Microsoft.AspNetCore.Server.Kestrel.Core (149)
AnyIPListenOptions.cs (1)
27catch (Exception ex) when (ex is not IOException
Internal\CertificatePathWatcherLoggerExtensions.cs (1)
32public static partial void LastModifiedTimeError(this ILogger<CertificatePathWatcher> logger, string path, Exception e);
Internal\Certificates\CertificateConfigLoader.cs (4)
112catch (Exception ex) 126catch (Exception ex) 140catch (Exception ex) 150private static InvalidOperationException CreateErrorGettingPrivateKeyException(string keyPath, Exception ex)
Internal\ConnectionDispatcher.cs (1)
71catch (Exception ex)
Internal\Http\Http1ChunkedEncodingMessageBody.cs (2)
93Exception? error = null; 152catch (Exception ex)
Internal\Http\Http1Connection.cs (1)
741catch (Exception)
Internal\Http\Http1MessageBody.cs (1)
43public override void Complete(Exception? exception)
Internal\Http\HttpProtocol.cs (16)
63protected Exception? _applicationException; 487catch (Exception ex) 515protected void PoisonBody(Exception abortReason) 607catch (Exception ex) 620catch (Exception ex) 694if (!_connectionAborted && !VerifyResponseContentLength(out var lengthException)) 707catch (Exception ex) 728catch (Exception ex) 826catch (Exception ex) 853catch (Exception ex) 909protected bool VerifyResponseContentLength([NotNullWhen(false)] out Exception? ex) 1433public void ReportApplicationError(Exception? ex) 1520public Task CompleteAsync(Exception? exception = null) 1546if (!VerifyResponseContentLength(out var lengthException)) 1567if (!VerifyResponseContentLength(out var lengthException)) 1577private static void ThrowException(Exception exception)
Internal\Http\HttpProtocol.FeatureCollection.cs (1)
244Exception? IBadRequestExceptionFeature.Error
Internal\Http\HttpRequestPipeReader.cs (3)
45public override void Complete(Exception? exception = null) 52public override ValueTask CompleteAsync(Exception? exception = null) 91public void Abort(Exception? error = null)
Internal\Http\HttpResponsePipeWriter.cs (2)
34public override void Complete(Exception? exception = null) 40public override ValueTask CompleteAsync(Exception? exception = null)
Internal\Http\IHttpResponseControl.cs (1)
18Task CompleteAsync(Exception? exception = null);
Internal\Http\MessageBody.cs (2)
61public abstract void Complete(Exception? exception); 63public virtual ValueTask CompleteAsync(Exception? exception)
Internal\Http\ZeroContentLengthMessageBody.cs (1)
32public override void Complete(Exception? ex) { }
Internal\Http2\Http2Connection.cs (4)
288Exception? error = null; 432catch (Exception ex) 1852Exception? error = null; 1885catch (Exception ex)
Internal\Http2\Http2FrameWriter.cs (3)
340catch (Exception ex) 556catch (Exception ex) 597catch (Exception ex)
Internal\Http2\Http2MessageBody.cs (2)
130public override void Complete(Exception? exception) 136public override ValueTask CompleteAsync(Exception? exception)
Internal\Http2\Http2Stream.cs (1)
614private void AbortCore(Exception abortReason)
Internal\Http3\Http3Connection.cs (4)
341Exception? error = null; 493catch (Exception ex) 644private static ConnectionAbortedException CreateConnectionAbortError(Exception? error, bool clientAbort) 723catch (Exception ex)
Internal\Http3\Http3FrameWriter.cs (2)
318catch (Exception ex) 373catch (Exception ex)
Internal\Http3\Http3MessageBody.cs (2)
98public override void Complete(Exception? exception) 104public override ValueTask CompleteAsync(Exception? exception)
Internal\Http3\Http3OutputProducer.cs (1)
462catch (Exception ex)
Internal\Http3\Http3PendingStream.cs (1)
80catch (Exception)
Internal\Http3\Http3PendingStreamException.cs (1)
8public Http3PendingStreamException(string message, long streamId, Exception? innerException = null)
Internal\Http3\Http3Stream.cs (3)
149private void AbortCore(Exception exception, Http3ErrorCode errorCode) 586Exception? error = null; 666catch (Exception ex)
Internal\HttpConnection.cs (1)
122catch (Exception ex)
Internal\Infrastructure\BodyControl.cs (1)
96public void Abort(Exception error)
Internal\Infrastructure\Heartbeat.cs (1)
64catch (Exception ex)
Internal\Infrastructure\KestrelConnection.cs (3)
119catch (Exception ex) 134catch (Exception ex) 145catch (Exception ex)
Internal\Infrastructure\KestrelConnectionOfT.cs (2)
46Exception? unhandledException = null; 71catch (Exception ex)
Internal\Infrastructure\KestrelMetrics.cs (4)
101public void ConnectionStop(ConnectionMetricsContext metricsContext, Exception? exception, List<KeyValuePair<string, object?>>? customTags, long startTimestamp, long currentTimestamp) 110private void ConnectionStopCore(ConnectionMetricsContext metricsContext, Exception? exception, List<KeyValuePair<string, object?>>? customTags, long startTimestamp, long currentTimestamp) 283public void TlsHandshakeStop(ConnectionMetricsContext metricsContext, long startTimestamp, long currentTimestamp, SslProtocols? protocol = null, Exception? exception = null) 292private void TlsHandshakeStopCore(ConnectionMetricsContext metricsContext, long startTimestamp, long currentTimestamp, SslProtocols? protocol = null, Exception? exception = null)
Internal\Infrastructure\KestrelTrace.BadRequests.cs (2)
16public void RequestProcessingError(string connectionId, Exception ex) 45public static partial void RequestProcessingError(ILogger logger, string connectionId, Exception ex);
Internal\Infrastructure\KestrelTrace.cs (2)
25public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Internal\Infrastructure\KestrelTrace.General.cs (4)
11public void ApplicationError(string connectionId, string traceIdentifier, Exception ex) 72public void RequestBodyDrainBodyReaderInvalidState(string connectionId, string traceIdentifier, Exception ex) 80public static partial void ApplicationError(ILogger logger, string connectionId, string traceIdentifier, Exception ex); 116public static partial void RequestBodyDrainBodyReaderInvalidState(ILogger logger, string connectionId, string traceIdentifier, Exception ex);
Internal\Infrastructure\KestrelTrace.Http2.cs (6)
22public void HPackDecodingError(string connectionId, int streamId, Exception ex) 45public void HPackEncodingError(string connectionId, int streamId, Exception ex) 83public void Http2UnexpectedConnectionQueueError(string connectionId, Exception ex) 112public static partial void HPackDecodingError(ILogger logger, string connectionId, int streamId, Exception ex); 124public static partial void HPackEncodingError(ILogger logger, string connectionId, int streamId, Exception ex); 145public static partial void Http2UnexpectedConnectionQueueError(ILogger logger, string connectionId, Exception ex);
Internal\Infrastructure\KestrelTrace.Http3.cs (6)
52public void Http3OutboundControlStreamError(string connectionId, Exception ex) 57public void QPackDecodingError(string connectionId, long streamId, Exception ex) 62public void QPackEncodingError(string connectionId, long streamId, Exception ex) 93public static partial void Http3OutboundControlStreamError(ILogger logger, string connectionId, Exception ex); 96public static partial void QPackDecodingError(ILogger logger, string connectionId, long streamId, Exception ex); 99public static partial void QPackEncodingError(ILogger logger, string connectionId, long streamId, Exception ex);
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (6)
22private static readonly Exception _successfullyCompletedSentinel = new UnreachableException(); 51private Exception? _completeException; 177catch (Exception ex) 193public override void Complete(Exception? exception = null) 288private void CompleteFlushUnsynchronized(FlushResult flushResult, Exception? flushEx) 405private static Exception CreateArgumentOutOfRangeException(string argumentName) { return new ArgumentOutOfRangeException(argumentName); }
Internal\Infrastructure\PipeWriterHelpers\TimingPipeFlusher.cs (1)
97catch (Exception ex)
Internal\Infrastructure\StatusCheckPipeWriter.cs (2)
52public override void Complete(Exception? exception = null) 82public override ValueTask CompleteAsync(Exception? exception = null)
Internal\Infrastructure\ThrowingPipeWriter.cs (1)
21public override void Complete(Exception? exception = null) => throw new InvalidOperationException(_message);
Internal\Infrastructure\WrappingPipeWriter.cs (2)
36public override void Complete(Exception? exception = null) 61public override ValueTask CompleteAsync(Exception? exception = null)
Internal\KestrelServerImpl.cs (3)
261catch (Exception ex) 390catch (Exception ex) 400catch (Exception ex)
LocalhostListenOptions.cs (3)
31var exceptions = new List<Exception>(); 38catch (Exception ex) when (!(ex is IOException or OperationCanceledException)) 52catch (Exception ex) when (!(ex is IOException or OperationCanceledException))
Middleware\HttpsConnectionMiddleware.cs (6)
239static void RecordHandshakeFailed(KestrelMetrics metrics, long startTimestamp, long currentTimestamp, ConnectionMetricsContext metricsContext, IConnectionMetricsTagsFeature? metricsTagsFeature, Exception ex) 265catch (Exception exception) when (exception is CryptographicException || exception is SecurityException) 584public static partial void AuthenticationFailed(this ILogger<HttpsConnectionMiddleware> logger, Exception exception); 611public static partial void FailedToFindCertificateInStore(this ILogger<HttpsConnectionMiddleware> logger, Exception exception); 614public static partial void FailedToOpenStore(this ILogger<HttpsConnectionMiddleware> logger, string? storeName, Exception exception); 619public static void FailedToOpenStore(this ILogger<HttpsConnectionMiddleware> logger, StoreLocation storeLocation, Exception exception)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\runtime\Http3\QPack\QPackDecodingException.cs (1)
20public QPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http3\QPack\QPackEncodingException.cs (1)
16public QPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (73)
BodyControlTests.cs (18)
24var ex = new Exception("My error"); 29await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1))); 31await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync())); 41var ex = new Exception("My error"); 48await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1))); 51await Assert.ThrowsAsync<Exception>(() => upgrade.ReadAsync(new byte[1], 0, 1))); 54await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync())); 65var ex = new Exception("My error"); 74await Assert.ThrowsAsync<Exception>(() => request.ReadAsync(new byte[1], 0, 1))); 77await Assert.ThrowsAsync<Exception>(() => upgrade.ReadAsync(new byte[1], 0, 1))); 79await Assert.ThrowsAsync<Exception>(async () => await requestPipe.ReadAsync())); 90var ex = new Exception("My error"); 95Assert.Throws<Exception>(() => requestPipe.AdvanceTo(new SequencePosition()))); 97Assert.Throws<Exception>(() => requestPipe.AdvanceTo(new SequencePosition(), new SequencePosition()))); 99Assert.Throws<Exception>(() => requestPipe.CancelPendingRead())); 101Assert.Throws<Exception>(() => requestPipe.TryRead(out var res))); 103Assert.Throws<Exception>(() => requestPipe.Complete())); 159public override void Complete(Exception exception)
BufferWriterTests.cs (1)
59catch (Exception ex)
ConcurrentPipeWriterTests.cs (7)
66var completeEx = new Exception(); 158var completeEx = new Exception(); 249var completeEx = new Exception(); 306var completeEx = new Exception(); 400var completeEx = new Exception(); 432public Exception CompleteException { get; set; } 457public override void Complete(Exception exception = null)
DiagnosticMemoryPoolTests.cs (3)
146Exception exception = null; 199Assert.Equal(new Exception[] { exception }, aggregateException.InnerExceptions); 221private static void ExpectDisposeAggregateException(MemoryPool<byte> memoryPool, params Exception[] inner)
HeartbeatTests.cs (1)
188var ex = new Exception();
Http1\Http1HttpProtocolFeatureCollectionTests.cs (1)
209catch (Exception ex)
HttpRequestPipeReaderTests.cs (3)
39var error = new Exception(); 41var exception = await Assert.ThrowsAsync<Exception>(() => pipeReader.ReadAsync().AsTask());
HttpRequestStreamTests.cs (6)
148var error = new Exception(); 150var exception = await Assert.ThrowsAsync<Exception>(() => stream.ReadAsync(new byte[1], 0, 1)); 182var error = new Exception(); 184var exception = await Assert.ThrowsAsync<Exception>(() => stream.CopyToAsync(Mock.Of<Stream>()));
LoggingStreamTests.cs (2)
66public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
MessageBodyTests.cs (1)
356catch (Exception)
src\Servers\Kestrel\shared\test\DummyApplication.cs (1)
38public void DisposeContext(HttpContext context, Exception exception)
src\Servers\Kestrel\shared\test\MockLogger.cs (2)
21public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
52public override void Complete(Exception exception = null) => _output.Complete(exception); 76public override void Complete(Exception exception = null) => _input.Complete(exception);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (7)
92catch (Exception) 113catch (Exception) 134catch (Exception e) 148catch (Exception) 164catch (Exception) 228catch (Exception e) 319catch (Exception e)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
34catch (Exception ex)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
src\Shared\test\Shared.Tests\runtime\Http2\HuffmanDecodingTests.cs (3)
271Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 288Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 333Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst));
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (2)
317catch (Exception ex) 359catch (Exception ex)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (27)
Mocks\NullPipeWriter.cs (1)
24public override void Complete(Exception exception = null)
ResponseHeadersWritingBenchmark.cs (1)
205public override void Complete(Exception exception = null) { }
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
15public Exception? CompleteException { get; private set; } 33public override ValueTask CompleteAsync(Exception? exception = null) 40public override void Complete(Exception? exception = null)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (3)
15public Exception? CompleteException { get; private set; } 33public override void Complete(Exception? exception = null) 40public override ValueTask CompleteAsync(Exception? exception = null)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
34catch (Exception ex) 49catch (Exception ex) 60catch (Exception ex)
src\Servers\Kestrel\shared\test\DummyApplication.cs (1)
38public void DisposeContext(HttpContext context, Exception exception)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
141return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, expectedErrorCode: expectedErrorCode ?? 0, matchExpectedErrorMessage: null); 145where TException : Exception 177private void AssertConnectionError<TException>(Http3ErrorCode expectedErrorCode, Action<Type, string[]> matchExpectedErrorMessage = null, params string[] expectedErrorMessage) where TException : Exception
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
GeneratedCodeTests.cs (1)
78catch (Exception)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (24)
Internal\NamedPipeConnection.cs (10)
27private Exception? _shutdownReason; 71catch (Exception ex) 79Exception? error = null; 133catch (Exception ex) 150Exception? shutdownReason = null; 151Exception? unexpectedError = null; 191catch (Exception ex) 209private void Shutdown(Exception? shutdownReason) 265catch (Exception ex) 291catch (Exception ex)
Internal\NamedPipeConnectionListener.cs (1)
91catch (Exception ex)
Internal\NamedPipeLog.cs (4)
23private static partial void ConnectionErrorCore(ILogger logger, string connectionId, Exception ex); 25public static void ConnectionError(ILogger logger, BaseConnectionContext connection, Exception ex) 34public static partial void ConnectionListenerAborted(ILogger logger, Exception exception); 81public static partial void ConnectionListenerBrokenPipe(ILogger logger, Exception ex);
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (46)
Internal\QuicConnectionContext.cs (3)
65catch (Exception ex) 187catch (Exception ex) 204catch (Exception ex)
Internal\QuicConnectionListener.cs (1)
188catch (Exception ex)
Internal\QuicLog.cs (8)
47private static partial void ConnectionErrorCore(ILogger logger, string connectionId, Exception ex); 49public static void ConnectionError(ILogger logger, BaseConnectionContext connection, Exception ex) 58private static partial void ConnectionAbortedCore(ILogger logger, string connectionId, long errorCode, Exception ex); 60public static void ConnectionAborted(ILogger logger, BaseConnectionContext connection, long errorCode, Exception ex) 80private static partial void StreamErrorCore(ILogger logger, string connectionId, Exception ex); 82public static void StreamError(ILogger logger, QuicStreamContext streamContext, Exception ex) 211public static partial void ConnectionListenerAborted(ILogger logger, Exception exception); 236public static partial void ConnectionListenerAcceptConnectionFailed(ILogger logger, Exception exception);
Internal\QuicStreamContext.cs (16)
36private volatile Exception? _shutdownReadReason; 37private volatile Exception? _shutdownWriteReason; 38private volatile Exception? _shutdownReason; 39private volatile Exception? _writeAbortException; 175catch (Exception ex) 190catch (Exception ex) 206Exception? error = null; 297catch (Exception ex) 316private Exception? ResolveCompleteReceiveException(Exception? error) 358catch (Exception ex) 369Exception? shutdownReason = null; 370Exception? unexpectedError = null; 460catch (Exception ex) 520private void ShutdownWrite(Exception? shutdownReason) 538catch (Exception ex)
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
15public Exception? CompleteException { get; private set; } 33public override ValueTask CompleteAsync(Exception? exception = null) 40public override void Complete(Exception? exception = null)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (3)
15public Exception? CompleteException { get; private set; } 33public override void Complete(Exception? exception = null) 40public override ValueTask CompleteAsync(Exception? exception = null)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
34catch (Exception ex) 49catch (Exception ex) 60catch (Exception ex)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (5)
QuicConnectionContextTests.cs (1)
651catch (Exception ex)
src\Servers\Kestrel\shared\test\ServerRetryHelper.cs (1)
34catch (Exception ex)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (21)
Internal\SocketConnection.cs (10)
26private volatile Exception? _shutdownReason; 85catch (Exception ex) 119catch (Exception ex) 134Exception? error = null; 248catch (Exception ex) 267Exception? shutdownReason = null; 268Exception? unexpectedError = null; 327catch (Exception ex) 365private void Shutdown(Exception? shutdownReason) 414catch (Exception ex)
Internal\SocketsLog.cs (2)
50private static partial void ConnectionErrorCore(ILogger logger, string connectionId, Exception ex); 52public static void ConnectionError(ILogger logger, SocketConnection connection, Exception ex)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (3)
23private readonly List<Exception> _blockAccessExceptions; 42_blockAccessExceptions = new List<Exception>(); 92internal void ReportException(Exception exception)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (6)
61catch (Exception exception) 92catch (Exception exception) 118catch (Exception exception) 156catch (Exception exception) 182catch (Exception exception) 210catch (Exception exception)
Microsoft.AspNetCore.Session (7)
CookieProtection.cs (1)
49catch (Exception ex)
DistributedSession.cs (2)
195catch (Exception exception) 267catch (Exception exception)
LoggingExtensions.cs (3)
9public static partial void ErrorClosingTheSession(this ILogger logger, Exception exception); 24public static partial void SessionCacheReadException(this ILogger logger, string sessionKey, Exception exception); 27public static partial void ErrorUnprotectingSessionCookie(this ILogger logger, Exception exception);
SessionMiddleware.cs (1)
106catch (Exception ex)
Microsoft.AspNetCore.Shared.Tests (28)
runtime\Http2\HuffmanDecodingTests.cs (3)
271Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 288Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 333Exception exception = Assert.Throws<HuffmanDecodingException>(() => Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst));
runtime\Http3\QPackDecoderTest.cs (2)
317catch (Exception ex) 359catch (Exception ex)
src\Shared\runtime\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\Shared\runtime\Http3\QPack\QPackDecodingException.cs (1)
20public QPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\Shared\runtime\Http3\QPack\QPackEncodingException.cs (1)
16public QPackEncodingException(string message, Exception innerException)
src\Shared\ServerInfrastructure\ManualResetValueTaskSource.cs (1)
19public void SetException(Exception error) => _core.SetException(error);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
21public static IList<StackFrameInfo> GetFrames(Exception exception, out AggregateException? error) 41List<Exception>? exceptions = null;
StackTraceHelperTest.cs (16)
22Exception exception = null; 30catch (Exception ex) 55var exception = Record.Exception(() => GenericMethod<string>(null)); 69var exception = Record.Exception(() => MethodWithOutParameter(out var value)); 83var exception = Record.Exception(() => MethodWithGenericOutParameter("Test", out int value)); 98var exception = Record.Exception(() => MethodWithRefParameter(ref value)); 113var exception = Record.Exception(() => MethodWithGenericRefParameter(ref value)); 128var exception = Record.Exception(() => MethodWithNullableParameter(value)); 142var exception = Record.Exception(() => new GenericClass<int>().Throw(0)); 167Exception exception = null; 172catch (Exception ex) 189var exception = Record.Exception(() => InvokeMethodOnTypeWithStackTraceHiddenAttribute()); 204var exception = Record.Exception(() => InvokeStaticMethodOnTypeWithStackTraceHiddenAttribute()); 219var exception = Record.Exception(() => new TypeWithMethodWithStackTraceHiddenAttribute().Throw()); 236Expression.New(typeof(Exception)))).Compile(); 237var exception = Record.Exception(action);
Microsoft.AspNetCore.SignalR.Client.Core (59)
HubConnection.cs (31)
97/// If this event was triggered from a connection error, the <see cref="Exception"/> that occurred will be passed in as the 121public event Func<Exception?, Task>? Closed; 127/// The <see cref="Exception"/> that occurred will be passed in as the sole argument to this handler. 141public event Func<Exception?, Task>? Reconnecting; 528catch (Exception ex) 989catch (Exception ex) 1011catch (Exception ex) 1056catch (Exception ex) 1156catch (Exception ex) 1187catch (Exception ex) 1252catch (Exception ex) 1383catch (Exception ex) 1398Exception? resultException = null; 1415catch (Exception ex) 1443catch (Exception ex) 1585catch (Exception ex) 1700catch (Exception ex) 1771private void CompleteClose(Exception? closeException) 1778private void RunCloseEvent(Exception? closeException) 1792catch (Exception ex) 1806private async Task ReconnectAsync(Exception? closeException) 1810var retryReason = closeException; 1881catch (Exception ex) 1927private TimeSpan? GetNextRetryDelay(long previousRetryCount, TimeSpan elapsedTime, Exception? retryReason) 1938catch (Exception ex) 1946private OperationCanceledException GetOperationCanceledException(string message, Exception innerException, CancellationToken cancellationToken) 1956private void RunReconnectingEvent(Exception? closeException) 1969catch (Exception ex) 1996catch (Exception ex) 2139public Exception? CloseException { get; set; } 2218public void CancelOutstandingInvocations(Exception? exception)
HubConnection.Log.cs (20)
79public static partial void FailedToSendInvocation(ILogger logger, string invocationId, Exception exception); 103public static partial void ShutdownWithError(ILogger logger, Exception exception); 145public static partial void ErrorDuringClosedEvent(ILogger logger, Exception exception); 154public static partial void ErrorInvokingClientSideMethod(ILogger logger, string methodName, Exception exception); 157public static partial void ErrorReceivingHandshakeResponse(ILogger logger, Exception exception); 181public static partial void ErrorStartingConnection(ILogger logger, Exception ex); 210public static partial void ServerDisconnectedWithError(ILogger logger, Exception ex); 237public static partial void ArgumentBindingFailure(ILogger logger, string? invocationId, string methodName, Exception exception); 264public static partial void ReconnectingWithError(ILogger logger, Exception exception); 276public static partial void ReconnectAttemptFailed(ILogger logger, Exception exception); 279public static partial void ErrorDuringReconnectingEvent(ILogger logger, Exception exception); 282public static partial void ErrorDuringReconnectedEvent(ILogger logger, Exception exception); 285public static partial void ErrorDuringNextRetryDelay(ILogger logger, Exception exception); 300public static partial void ErrorInvalidHandshakeResponse(ILogger logger, Exception exception); 302public static void ErrorHandshakeTimedOut(ILogger logger, TimeSpan handshakeTimeout, Exception exception) 306private static partial void ErrorHandshakeTimedOut(ILogger logger, double HandshakeTimeoutSeconds, Exception exception); 309public static partial void ErrorHandshakeCanceled(ILogger logger, Exception exception); 312public static partial void ErroredStream(ILogger logger, string streamId, Exception exception); 324public static partial void ErrorSendingInvocationResult(ILogger logger, string invocationId, string target, Exception exception); 327public static partial void ErrorSendingStreamCompletion(ILogger logger, string streamId, Exception exception);
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
306catch (Exception ex)
Internal\InvocationRequest.cs (5)
63public abstract void Fail(Exception exception); 121public override void Fail(Exception exception) 147catch (Exception ex) 196public override void Fail(Exception exception) 251public static partial void ErrorWritingStreamItem(ILogger logger, string invocationId, Exception exception);
RetryContext.cs (1)
27public Exception? RetryReason { get; set; }
src\SignalR\common\Shared\MessageBuffer.cs (1)
290catch (Exception ex)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (87)
HubConnectionTests.cs (76)
110catch (Exception ex) 143var ex = await Assert.ThrowsAnyAsync<Exception>(() => connection.StartAsync()).DefaultTimeout(); 146catch (Exception ex) 175catch (Exception ex) 204catch (Exception ex) 232catch (Exception ex) 264catch (Exception ex) 299catch (Exception ex) 337catch (Exception ex) 362catch (Exception ex) 391catch (Exception ex) 431catch (Exception ex) 466catch (Exception ex) 512catch (Exception ex) 547catch (Exception ex) 584catch (Exception ex) 626catch (Exception ex) 668catch (Exception ex) 702catch (Exception ex) 744catch (Exception ex) 774catch (Exception ex) 811catch (Exception ex) 858catch (Exception ex) 911catch (Exception ex) 952catch (Exception ex) 993catch (Exception ex) 1023catch (Exception ex) 1057catch (Exception ex) 1084catch (Exception ex) 1111catch (Exception ex) 1138catch (Exception ex) 1165catch (Exception ex) 1193catch (Exception ex) 1221catch (Exception ex) 1249catch (Exception ex) 1276catch (Exception ex) 1303catch (Exception ex) 1330catch (Exception ex) 1363var closedTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 1372var exception = await closedTcs.Task.DefaultTimeout(); 1379catch (Exception ex) 1417var closedTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 1426var exception = await closedTcs.Task.DefaultTimeout(); 1433catch (Exception ex) 1496catch (Exception ex) 1551catch (Exception ex) 1583catch (Exception ex) 1625catch (Exception ex) 1660catch (Exception ex) 1695catch (Exception ex) 1730catch (Exception ex) 1781catch (Exception ex) 1840catch (Exception ex) 1948catch (Exception ex) 1983catch (Exception ex) 2019catch (Exception ex) 2050catch (Exception ex) 2080catch (Exception ex) 2183catch (Exception ex) 2243catch (Exception ex) 2309catch (Exception ex) 2349catch (Exception ex) 2392catch (Exception ex) 2445catch (Exception ex) 2488catch (Exception ex) 2538catch (Exception ex) 2597catch (Exception ex) 2666catch (Exception ex) 2739catch (Exception ex) 2774var closedTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 2791catch (Exception ex) 2833catch (Exception ex) 2905var ex = await Assert.ThrowsAnyAsync<Exception>(() => resultTask); 2911catch (Exception ex)
HubConnectionTests.Tracing.cs (7)
118catch (Exception ex) 289catch (Exception ex) 419catch (Exception ex) 516catch (Exception ex) 608await Assert.ThrowsAnyAsync<Exception>( 611catch (Exception ex) 710catch (Exception ex)
HubProtocolVersionTests.cs (4)
55catch (Exception ex) 88catch (Exception ex) 148catch (Exception ex) 185catch (Exception ex)
Microsoft.AspNetCore.SignalR.Client.Tests (74)
HttpConnectionFactoryTests.cs (1)
40await Assert.ThrowsAnyAsync<Exception>(async () => await factory.ConnectAsync(new UriEndPoint(new Uri("http://example.com"))));
HttpConnectionTests.ConnectionLifecycle.cs (4)
91var expected = new Exception("Transport failed to start"); 143var expected = new Exception("Transport failed to start"); 449var innerEx = ex.InnerExceptions[2]; 450var innerInnerEx = innerEx.InnerException;
HttpConnectionTests.Negotiate.cs (1)
605private async Task RunInvalidNegotiateResponseTest<TException>(string negotiatePayload, string expectedExceptionMessage) where TException : Exception
HubConnectionTests.ConnectionLifecycle.cs (2)
617var closedEventTcs = new TaskCompletionSource<Exception>(); 629var exception = await closedEventTcs.Task.DefaultTimeout();
HubConnectionTests.cs (11)
70var closedEventTcs = new TaskCompletionSource<Exception>(); 358var closeTcs = new TaskCompletionSource<Exception>(); 386var closeTcs = new TaskCompletionSource<Exception>(); 695catch (Exception) 718catch (Exception ex) 897var closedEventTcs = new TaskCompletionSource<Exception>(); 908var exception = await closedEventTcs.Task.DefaultTimeout(); 929var closedEventTcs = new TaskCompletionSource<Exception>(); 940var exception = await closedEventTcs.Task.DefaultTimeout(); 967private Exception _error; 977public static MockHubProtocol Throw(Exception error)
HubConnectionTests.Protocol.cs (4)
145var closedTcs = new TaskCompletionSource<Exception>(); 161var closeException = await closedTcs.Task.DefaultTimeout(); 174var closedTcs = new TaskCompletionSource<Exception>(); 190var closeException = await closedTcs.Task.DefaultTimeout();
HubConnectionTests.Reconnect.cs (49)
40var exception = new Exception(); 46var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 127var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 129var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 155var firstException = new Exception(); 164var reconnectException = new Exception(); 176var closeError = await closedErrorTcs.Task.DefaultTimeout(); 228var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 229var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 252var firstException = new Exception(); 261var reconnectException = new Exception(); 264var closeError = await closedErrorTcs.Task.DefaultTimeout(); 323var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 324var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 347var firstException = new Exception(); 352var reconnectException = new Exception(); 355var closeError = await closedErrorTcs.Task.DefaultTimeout(); 403var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 405var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 429var firstException = new Exception(); 444reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 447var secondException = new Exception(); 464var closeError = await closedErrorTcs.Task.DefaultTimeout(); 501var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 503var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 535var reconnectingException = await reconnectingErrorTcs.Task.DefaultTimeout(); 548var closeError = await closedErrorTcs.Task.DefaultTimeout(); 575var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 609var closeError = await closedErrorTcs.Task.DefaultTimeout(); 639var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 661var firstException = new Exception(); 716var firstException = new Exception(); 719Assert.Same(firstException, await Assert.ThrowsAsync<Exception>(() => startTask).DefaultTimeout()); 764var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 766var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 796var firstException = new Exception(); 805var secondException = new Exception(); 826var closeError = await closedErrorTcs.Task.DefaultTimeout(); 871var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 873var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 903var firstException = new Exception(); 946var closeError = await closedErrorTcs.Task.DefaultTimeout(); 997var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 998var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 1023var firstException = new Exception(); 1032var secondException = new Exception(); 1075var reconnectingErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 1076var closedErrorTcs = new TaskCompletionSource<Exception>(TaskCreationOptions.RunContinuationsAsynchronously); 1100var firstException = new Exception();
TestConnection.cs (2)
199public void CompleteFromTransport(Exception ex = null) 204private async ValueTask DisposeCoreAsync(Exception ex = null)
Microsoft.AspNetCore.SignalR.Common (6)
HubException.cs (2)
41public HubException(string? message, Exception? innerException) : base(message, innerException) 51/// <exception cref="SerializationException">The class name is <c>null</c> or <see cref="Exception.HResult"/> is zero (0).</exception>
Protocol\HubMethodInvocationMessage.cs (4)
106catch (Exception ex) 115catch (Exception ex) 161catch (Exception ex) 170catch (Exception ex)
Microsoft.AspNetCore.SignalR.Core (53)
Hub.cs (1)
84public virtual Task OnDisconnectedAsync(Exception? exception)
HubConnectionContext.cs (9)
114internal Exception? CloseException { get; private set; } 285catch (Exception ex) 313catch (Exception ex) 330catch (Exception ex) 358catch (Exception ex) 384catch (Exception ex) 422catch (Exception ex) 639catch (Exception ex) 735catch (Exception ex)
HubConnectionContext.Log.cs (3)
25public static partial void HandshakeFailed(ILogger logger, Exception? exception); 28public static partial void FailedWritingMessage(ILogger logger, Exception exception); 34public static partial void AbortFailed(ILogger logger, Exception exception);
HubConnectionHandler.cs (7)
167catch (Exception ex) 187catch (Exception ex) 200private async Task HubOnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 202var disconnectException = exception; 232catch (Exception ex) 239private async Task SendCloseAsync(HubConnectionContext connection, Exception? exception, bool allowReconnect) 257catch (Exception ex)
HubConnectionHandlerLog.cs (4)
11public static partial void ErrorDispatchingHubEvent(ILogger logger, string hubMethod, Exception exception); 14public static partial void ErrorProcessingRequest(ILogger logger, Exception exception); 17public static partial void AbortFailed(ILogger logger, Exception exception); 20public static partial void ErrorSendingClose(ILogger logger, Exception exception);
HubLifetimeContext.cs (1)
7/// Context for the hub lifetime events <see cref="Hub.OnConnectedAsync"/> and <see cref="Hub.OnDisconnectedAsync(Exception)"/>.
IHubFilter.cs (3)
28/// Allows handling of the <see cref="Hub.OnDisconnectedAsync(Exception)"/> method. 34Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next) => next(context, exception);
Internal\DefaultHubDispatcher.cs (10)
33private readonly Func<HubLifetimeContext, Exception?, Task>? _onDisconnectedMiddleware; 107catch (Exception ex) 119public override async Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 142catch (Exception ex) 415catch (Exception ex) 470catch (Exception ex) 541catch (Exception ex) 571var exception = ex.InnerException ?? ex; 577catch (Exception ex) 894private static void SetActivityError(Activity? activity, Exception ex)
Internal\DefaultHubDispatcherLog.cs (3)
51public static partial void FailedInvokingHubMethod(ILogger logger, string hubMethod, Exception exception); 101public static partial void InvalidHubParameters(ILogger logger, string hubMethod, Exception exception); 110public static partial void FailedStreaming(ILogger logger, string invocationId, string hubMethod, Exception exception);
Internal\ErrorMessageHelper.cs (1)
8internal static string BuildErrorMessage(string message, Exception exception, bool includeExceptionDetails)
Internal\HubDispatcher.cs (1)
12public abstract Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception);
Internal\HubFilterFactory.cs (2)
56public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next)
src\SignalR\common\Shared\ClientResultsManager.cs (4)
161public new void SetException(Exception exception) 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 181public static new bool TrySetException(IEnumerable<Exception> exceptions) 186public static new bool TrySetException(Exception exception)
src\SignalR\common\Shared\MessageBuffer.cs (1)
290catch (Exception ex)
StreamTracker.cs (3)
85public void CompleteAll(Exception ex) 103void TryComplete(Exception? ex); 137public void TryComplete(Exception? ex)
Microsoft.AspNetCore.SignalR.Microbenchmarks (2)
Shared\TestPipeReader.cs (1)
30public override void Complete(Exception exception = null)
Shared\TestPipeWriter.cs (1)
34public override void Complete(Exception exception = null)
Microsoft.AspNetCore.SignalR.Protocols.Json (8)
Protocol\JsonHubProtocol.cs (7)
248catch (Exception ex) 281catch (Exception ex) 312catch (Exception ex) 367catch (Exception ex) 393catch (Exception ex) 445catch (Exception ex) 851catch (Exception ex)
src\SignalR\common\Shared\TryGetReturnType.cs (1)
19catch (Exception)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (14)
Protocol\DefaultMessagePackHubProtocolWorker.cs (1)
25catch (Exception ex)
Protocol\MessagePackHubProtocolWorker.cs (12)
94catch (Exception ex) 124catch (Exception ex) 151catch (Exception ex) 195catch (Exception ex) 316catch (Exception ex) 621catch (Exception ex) 633catch (Exception ex) 645catch (Exception ex) 665catch (Exception ex) 677catch (Exception ex) 689catch (Exception ex) 701catch (Exception ex)
src\SignalR\common\Shared\TryGetReturnType.cs (1)
19catch (Exception)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (10)
Protocol\NewtonsoftJsonHubProtocol.cs (9)
238catch (Exception ex) 269catch (Exception ex) 297catch (Exception ex) 357catch (Exception ex) 383catch (Exception ex) 407catch (Exception ex) 441catch (Exception ex) 855catch (Exception ex) 921catch (Exception ex)
src\SignalR\common\Shared\TryGetReturnType.cs (1)
19catch (Exception)
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
HubLifetimeManagerTestBase.cs (1)
309await Assert.ThrowsAnyAsync<Exception>(() => invoke2).DefaultTimeout();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (17)
Internal\RedisLog.cs (6)
47public static partial void ConnectionFailed(ILogger logger, Exception exception); 50public static partial void FailedWritingMessage(ILogger logger, Exception exception); 53public static partial void InternalMessageFailed(ILogger logger, Exception exception); 59public static partial void ErrorForwardingResult(ILogger logger, string invocationId, Exception ex); 62public static partial void ErrorConnecting(ILogger logger, Exception ex); 65public static partial void ErrorParsingResult(ILogger logger, string hubProtocol, Exception? ex);
RedisHubLifetimeManager.cs (7)
473catch (Exception ex) 509catch (Exception ex) 563catch (Exception ex) 605catch (Exception ex) 636catch (Exception ex) 694catch (Exception ex) 748catch (Exception ex)
src\SignalR\common\Shared\ClientResultsManager.cs (4)
161public new void SetException(Exception exception) 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 181public static new bool TrySetException(IEnumerable<Exception> exceptions) 186public static new bool TrySetException(Exception exception)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Docker.cs (1)
80catch (Exception ex)
RedisServerFixture.cs (1)
67catch (Exception ex)
Microsoft.AspNetCore.SignalR.Tests (31)
EndToEndTests.cs (7)
198catch (Exception ex) 243catch (Exception ex) 296catch (Exception ex) 357catch (Exception ex) 449catch (Exception ex) 583catch (Exception ex) 623catch (Exception ex)
HubConnectionHandlerTests.Activity.cs (1)
435mockHttpRequestActivity, exceptionType: typeof(Exception));
HubConnectionHandlerTests.cs (1)
2953public override void Complete(Exception exception = null) =>
HubConnectionHandlerTestUtils\Hubs.cs (10)
128public override Task OnDisconnectedAsync(Exception e) 263catch (Exception) 277catch (Exception ex) 320catch (Exception ex) 355catch (Exception ex) 601public override Task OnDisconnectedAsync(Exception exception) 1250public override Task OnDisconnectedAsync(Exception exception) 1289public override Task OnDisconnectedAsync(Exception exception) 1306public Exception DisconnectedException { get; set; } 1319public override async Task OnDisconnectedAsync(Exception ex)
NativeAotTests.cs (2)
417public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
TestFilters.cs (10)
35public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 66public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 97public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 121public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next) 165public Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next)
Microsoft.AspNetCore.SignalR.Tests.Utils (7)
ChannelExtensions.cs (1)
29catch (Exception) when (suppressExceptions)
src\Shared\SignalR\LogSinkProvider.cs (4)
32public void Log<TState>(string categoryName, LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 71public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
src\Shared\SignalR\WrappingLoggerFactory.cs (2)
73public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.SpaProxy (6)
SpaProxyLaunchManager.cs (5)
59catch (Exception ex) 85catch (Exception exception) when (exception is HttpRequestException || 116catch (Exception exception) when (exception is HttpRequestException || 212catch (Exception exception) 354catch (Exception)
SpaProxyStartupFilter.cs (1)
45catch (Exception ex)
Microsoft.AspNetCore.SpaServices.Extensions (2)
AngularCli\AngularCliMiddleware.cs (1)
118catch (Exception)
Npm\NodeScriptRunner.cs (1)
134catch (Exception ex)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (5)
ListLoggerFactory.cs (5)
28public List<(LogLevel Level, EventId Id, string Message, object State, Exception Exception)> Log => Logger.LoggedEvents; 68public List<(LogLevel, EventId, string, object, Exception)> LoggedEvents { get; } 69= new List<(LogLevel, EventId, string, object, Exception)>(); 80LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.StaticAssets (1)
LoggerExtensions.cs (1)
57public static partial void WriteCancelled(this ILogger logger, Exception ex);
Microsoft.AspNetCore.StaticFiles (1)
LoggerExtensions.cs (1)
60public static partial void WriteCancelled(this ILogger logger, Exception ex);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (2)
StaticFileMiddlewareTests.cs (2)
241Exception exception = null; 259catch (Exception ex)
Microsoft.AspNetCore.TestHost (23)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (7)
66Action<Exception?>? entrypointCompleted = null) 206private readonly Action<Exception?>? _entrypointCompleted; 209public HostingListener(string[] args, MethodInfo entryPoint, TimeSpan waitTimeout, bool stopApplication, Action<object>? configure, Action<Exception?>? entrypointCompleted) 227Exception? exception = null; 260catch (Exception ex) 304public void OnError(Exception error) 356throw (Exception)Activator.CreateInstance(publicHostAbortedExceptionType)!;
ApplicationWrapper.cs (3)
15internal abstract void DisposeContext(object context, Exception? exception); 39internal override void DisposeContext(object context, Exception? exception) 44void IHttpApplication<TContext>.DisposeContext(TContext context, Exception? exception)
HttpContextBuilder.cs (4)
143catch (Exception ex) 198catch (Exception ex) 225catch (Exception ex) 252internal void Abort(Exception exception)
RequestLifetimeFeature.cs (2)
11private readonly Action<Exception> _abort; 13public RequestLifetimeFeature(Action<Exception> abort)
ResponseBodyPipeWriter.cs (2)
43internal void Abort(Exception innerException) 70public override void Complete(Exception? exception = null)
ResponseBodyReaderStream.cs (2)
17private Exception? _abortException; 114internal void Abort(Exception innerException)
ResponseFeature.cs (3)
13private readonly Action<Exception> _abort; 20public ResponseFeature(Action<Exception> abort) 132catch (Exception ex)
Microsoft.AspNetCore.TestHost.Tests (18)
ClientHandlerTests.cs (7)
585catch (Exception ex) 619internal override void DisposeContext(object context, Exception exception) 624void IHttpApplication<TestHostingContext>.DisposeContext(TestHostingContext context, Exception exception) 663internal override void DisposeContext(object context, Exception exception) 668void IHttpApplication<TestHostingContext>.DisposeContext(TestHostingContext context, Exception exception) 719public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception);
HttpContextBuilderTests.cs (2)
355public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception);
RequestLifetimeTests.cs (2)
67var rex = ex.GetBaseException(); 90var rex = ex.GetBaseException();
TestClientTests.cs (6)
389catch (Exception ex) 493await Assert.ThrowsAnyAsync<Exception>(() => requestStream.WriteAsync(buffer).AsTask()); 744public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) => formatter(state, exception); 840catch (Exception e) 870catch (Exception e)
TestServerTests.cs (1)
765await Assert.ThrowsAsync<Exception>(() => server.CreateClient().GetAsync("/path"));
Microsoft.AspNetCore.Testing (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.AspNetCore.Testing.Tests (8)
FakesExtensionsTests.cs (7)
109var exception = Record.Exception(() => hostMock.Object.CreateClient(null, _ => false)); 120var exception = Record.Exception(() => hostMock.Object.CreateClient(null, _ => false)); 129var exception = Record.Exception(() => ((IHost)null!).CreateClient(new TestHandler(), _ => true)); 140var exception = Record.Exception(() => hostMock.Object.CreateClient(new TestHandler(), _ => true)); 187var exception = Record.Exception(() => hostMock.Object.GetListenUris()); 202var exception = Record.Exception(() => hostMock.Object.GetListenUris()); 210var exception = Record.Exception(() => ((IHost)null!).GetListenUris());
FakeStartupTests.cs (1)
17var exception = Record.Exception(() =>
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (3)
1794Assert.ThrowsAny<Exception>(() => builder.Build()); 2601var ex = await Record.ExceptionAsync(async () => 2990public void OnError(Exception error)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnTester.cs (1)
101catch (Exception ex)
Microsoft.AspNetCore.WebSockets.Tests (10)
BufferStream.cs (2)
17private Exception _abortException; 309internal void Abort(Exception innerException)
KestrelWebSocketHelpers.cs (2)
20Exception exceptionFromApp = null; 32catch (Exception ex)
WebSocketMiddlewareTests.cs (6)
512Exception receiveException = null; 542catch (Exception ex) 610catch (Exception ex) 810catch (Exception ex) 842var ex = await Assert.ThrowsAnyAsync<Exception>(() => tcs.Task);
Microsoft.AspNetCore.WebUtilities.Tests (1)
HttpRequestStreamReaderTest.cs (1)
564private Exception SyncOperationForbiddenException()
Microsoft.Build (334)
BackEnd\BuildManager\BuildManager.cs (18)
650catch (Exception) 1027catch (Exception e) 1340catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1376catch (Exception e) 1447catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1458catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1570catch (Exception ex) 1590catch (Exception e) 1659private void CompleteSubmissionWithException(BuildSubmission submission, BuildRequestConfiguration configuration, Exception exception) 1680private void HandleSubmissionException(BuildSubmissionBase submission, Exception ex) 1694foreach (Exception innerException in ae.InnerExceptions) 1816catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1848catch (Exception ex) when (IsInvalidProjectOrIORelatedException(ex)) 1887private bool IsInvalidProjectOrIORelatedException(Exception e) 2328catch (Exception e) 2802private void OnThreadException(Exception e) 2848private void OnLoggingThreadException(Exception e) 2986catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
BackEnd\BuildManager\BuildSubmission.cs (4)
90protected internal abstract TResultData CreateFailedResult(Exception exception); 92internal override BuildResultBase CompleteResultsWithException(Exception exception) 95private TResultData CompleteResults(Exception exception) 215protected internal override BuildResult CreateFailedResult(Exception exception)
BackEnd\BuildManager\BuildSubmissionBase.cs (1)
94internal abstract BuildResultBase CompleteResultsWithException(Exception exception);
BackEnd\BuildManager\CacheSerialization.cs (3)
107catch (Exception e) 115public static (IConfigCache ConfigCache, IResultsCache ResultsCache, Exception exception) DeserializeCaches(string inputCacheFile) 135catch (Exception e)
BackEnd\Client\MSBuildClient.cs (5)
367catch (Exception ex) 390catch (Exception ex) 429catch (Exception ex) 480catch (Exception ex) 626catch (Exception ex)
BackEnd\Client\MSBuildClientPacketPump.cs (2)
37public Exception? PacketPumpException { get; set; } 310catch (Exception ex)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (7)
223var deactivateExceptions = new List<Exception>(_requests.Count); 238catch (Exception e) 257catch (Exception e) 299catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 669private void RaiseEngineException(Exception e) 899catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1383catch (Exception e)
BackEnd\Components\BuildRequestEngine\IBuildRequestEngine.cs (1)
54internal delegate void EngineExceptionDelegate(Exception e);
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
452catch (Exception e)
BackEnd\Components\Communications\NodeFailedToLaunchException.cs (2)
33internal NodeFailedToLaunchException(Exception innerException) 37public NodeFailedToLaunchException(string message, Exception inner)
BackEnd\Components\Communications\NodeLauncher.cs (1)
123catch (Exception ex)
BackEnd\Components\Communications\NodeProviderInProc.cs (2)
406Exception e; 432private void InProcNodeShutdown(NodeEngineShutdownReason reason, Exception e)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (4)
239ConcurrentQueue<Exception> exceptions = new(); 250catch (Exception ex) 466catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 905catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
BackEnd\Components\Logging\BuildLoggingContext.cs (1)
60internal void LogFatalTaskError(Exception exception, BuildEventFileInfo file, string taskName)
BackEnd\Components\Logging\EventSourceSink.cs (4)
342/// <exception cref="Exception">ExceptionHandling.IsCriticalException exceptions will not be wrapped</exception> 358catch (Exception exception) 381/// <exception cref="Exception">ExceptionHandling.IsCriticalException exceptions will not be wrapped</exception> 407catch (Exception exception)
BackEnd\Components\Logging\ILoggingService.cs (5)
24internal delegate void LoggingExceptionDelegate(Exception e); 417void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file); 426void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName); 436void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs); 447void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName);
BackEnd\Components\Logging\LoggingContext.cs (2)
244internal void LogFatalError(Exception exception, BuildEventFileInfo file, string messageResourceName, params object?[]? messageArgs) 299internal void LogFatalBuildError(Exception exception, BuildEventFileInfo file)
BackEnd\Components\Logging\LoggingService.cs (5)
1483catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException) 1532catch (Exception e) 1796/// <exception cref="Exception">Any exception which is a ExceptionHandling.IsCriticalException will not be wrapped</exception> 1823catch (Exception e) when (!ExceptionHandling.IsCriticalException(e) && e is not LoggerException) 1898private void RaiseLoggingExceptionEvent(Exception ex)
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (4)
194public void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file) 208public void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName) 225public void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) 259public void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName)
BackEnd\Components\Logging\TaskLoggingContext.cs (1)
148internal void LogTaskWarningFromException(Exception exception, BuildEventFileInfo file, string taskName)
BackEnd\Components\ProjectCache\CacheResult.cs (3)
55internal Exception? Exception { get; } 74private CacheResult(Exception exception) 103internal static CacheResult IndicateException(Exception e)
BackEnd\Components\ProjectCache\ProjectCacheException.cs (3)
25Exception innerException, 37internal ProjectCacheException(string message, Exception inner) 54Exception innerException,
BackEnd\Components\ProjectCache\ProjectCacheService.cs (8)
231catch (Exception e) 302catch (Exception e) 445catch (Exception e) 470catch (Exception ex) 556catch (Exception e) when (e is not ProjectCacheException) 778catch (Exception e) when (e is not ProjectCacheException) 847catch (Exception e) when (e is not ProjectCacheException) 874private static void HandlePluginException(Exception e, string apiExceptionWasThrownFrom)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
772Exception thrownException = null; 812catch (Exception 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 (6)
569catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 754Exception taskException = null; 809catch (Exception ex) 897else if (type == typeof(Exception) || type.GetTypeInfo().IsSubclassOf(typeof(Exception))) 909Exception exceptionToLog = taskException;
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\Components\Scheduler\SchedulerCircularDependencyException.cs (1)
40internal SchedulerCircularDependencyException(string message, Exception inner)
BackEnd\Components\SdkResolution\MainNodeSdkResolverService.cs (1)
81catch (Exception e)
BackEnd\Components\SdkResolution\SdkResolverException.cs (2)
22public SdkResolverException(string resourceName, SdkResolver resolver, SdkReference sdk, Exception innerException, params string[] args) 30internal SdkResolverException(string message, Exception inner)
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (2)
277catch (Exception e) 298catch (Exception e)
BackEnd\Components\SdkResolution\SdkResolverService.cs (2)
332catch (Exception e) when ((e is FileNotFoundException || e is FileLoadException) && sdkResolver.GetType().GetTypeInfo().Name.Equals("NuGetSdkResolver", StringComparison.Ordinal)) 341catch (Exception e)
BackEnd\Node\INode.cs (2)
18internal delegate void NodeShutdownDelegate(NodeEngineShutdownReason reason, Exception e); 31NodeEngineShutdownReason Run(out Exception shutdownException);
BackEnd\Node\InProcNode.cs (8)
74private Exception _shutdownException; 133public NodeEngineShutdownReason Run(out Exception shutdownException) 180catch (Exception e) 285private void OnLoggingThreadException(Exception e) 293private void OnEngineException(Exception e) 303private NodeEngineShutdownReason HandleShutdown(out Exception exception) 314catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 497HandleShutdown(out Exception exception);
BackEnd\Node\OutOfProcNode.cs (10)
122private Exception _shutdownException; 223public NodeEngineShutdownReason Run(out Exception shutdownException) 235public NodeEngineShutdownReason Run(bool enableReuse, out Exception shutdownException) 247public NodeEngineShutdownReason Run(bool enableReuse, bool lowPriority, out Exception shutdownException) 425private void OnLoggingThreadException(Exception e) 433private void OnEngineException(Exception e) 443private NodeEngineShutdownReason HandleShutdown(out Exception exception) 486catch (Exception ex) 798catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 832HandleShutdown(out Exception exception);
BackEnd\Node\OutOfProcServerNode.cs (6)
72private Exception? _shutdownException = null; 101public NodeEngineShutdownReason Run(out Exception? shutdownException) 136private NodeEngineShutdownReason RunInternal(out Exception? shutdownException, ServerNodeHandshake handshake) 246private NodeEngineShutdownReason HandleShutdown(out Exception? exception) 338catch (Exception e) 401catch (Exception)
BackEnd\Shared\BuildAbortedException.cs (3)
53public BuildAbortedException(string message, Exception innerException) 57internal static BuildAbortedException CreateFromRemote(string message, Exception innerException) 62private BuildAbortedException(string message, Exception innerException, bool calledFromDeserialization)
BackEnd\Shared\BuildRequestConfiguration.cs (2)
711catch (Exception e) when (e is DirectoryNotFoundException or UnauthorizedAccessException) 750catch (Exception e) when (e is DirectoryNotFoundException or UnauthorizedAccessException)
BackEnd\Shared\BuildResult.cs (5)
98private Exception? _requestException; 171internal BuildResult(BuildRequest request, Exception? exception) 214internal BuildResult(BuildRequest request, BuildResult? existingResults, Exception? exception) 226internal BuildResult(BuildRequest request, BuildResult? existingResults, string[]? targetNames, Exception? exception) 350public override Exception? Exception
BackEnd\Shared\BuildResultBase.cs (1)
23public abstract Exception? Exception { get; internal set; }
BackEnd\Shared\CircularDependencyException.cs (1)
35internal CircularDependencyException(string message, Exception inner)
BackEnd\Shared\IBuildResults.cs (1)
20Exception Exception { get; }
BackEnd\Shared\ITargetResult.cs (1)
42Exception Exception { get; }
BackEnd\Shared\TargetResult.cs (1)
87public Exception Exception
BackEnd\Shared\WorkUnitResult.cs (4)
70private Exception _exception; 85internal WorkUnitResult(WorkUnitResultCode resultCode, WorkUnitActionCode actionCode, Exception e) 117internal Exception Exception => _exception; 155Exception aggregateException = _exception;
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (8)
374catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 513catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 656catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 767catch (Exception ex) 986catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1193catch (Exception ex) 1355catch (Exception e) when (e is not LoggerException && e is not InternalLoggerException && !ExceptionHandling.NotExpectedReflectionException(e)) 1605catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (3)
60foreach (Exception? unrolledEx in ex.LoaderExceptions.Where(e => e != null).Prepend(ex)) 65catch (Exception ex) 72void ReportLoadingError(Exception ex)
BuildCheck\Infrastructure\BuildCheckCentralContext.cs (1)
257catch (Exception e)
BuildCheck\Infrastructure\BuildCheckConfigurationException.cs (2)
16public BuildCheckConfigurationException(string message, Exception innerException, BuildCheckConfigurationErrorScope buildCheckConfigurationErrorScope = BuildCheckConfigurationErrorScope.SingleRule) : base(message, innerException) 26public BuildCheckConfigurationException(string message, Exception innerException) : base(message, innerException)
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (2)
296catch (Exception e) 735catch (Exception e)
BuildCheck\Infrastructure\CheckContext\CheckDispatchingContext.cs (1)
68public void DispatchFailedAcquisitionTelemetry(string assemblyName, Exception exception)
BuildCheck\Infrastructure\CheckContext\CheckLoggingContext.cs (1)
45public void DispatchFailedAcquisitionTelemetry(string assemblyName, Exception exception)
BuildCheck\Infrastructure\CheckContext\ICheckContext.cs (1)
48void DispatchFailedAcquisitionTelemetry(string assemblyName, Exception exception);
BuildCheck\Infrastructure\ConfigurationProvider.cs (1)
199catch (Exception exception)
Construction\ProjectRootElement.cs (3)
1968catch (Exception) 2036catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 2087catch (Exception ex) when (!ExceptionHandling.NotExpectedIoOrXmlException(ex))
Construction\Solution\ProjectInSolution.cs (1)
193catch (Exception)
Construction\Solution\SolutionFile.cs (4)
327catch (Exception ex) 641catch (Exception e) when (e is JsonException || e is KeyNotFoundException || e is InvalidOperationException) 663catch (Exception e) when (e is JsonException || e is KeyNotFoundException || e is InvalidOperationException) 735catch (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\ProjectCollection.cs (2)
373catch (Exception) 1748catch (Exception 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))
Errors\InternalLoggerException.cs (3)
66public InternalLoggerException(string message, Exception innerException) 85Exception innerException, 241Exception innerException,
Errors\InvalidProjectFileException.cs (2)
62public InvalidProjectFileException(string message, Exception innerException) 216Exception innerException) : base(message, innerException)
Errors\InvalidToolsetDefinitionException.cs (3)
50public InvalidToolsetDefinitionException(string message, Exception innerException) 86public InvalidToolsetDefinitionException(string message, string errorCode, Exception innerException) 165Exception innerException,
Errors\RegistryException.cs (2)
40public RegistryException(string message, Exception innerException) 76public RegistryException(string message, string source, Exception innerException)
ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
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 (15)
1450catch (Exception) when (options.HasFlag(ExpanderOptions.LeavePropertiesUnexpandedOnError)) 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)) 2624catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException) 2822catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException) 2857catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException) 2890catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException) 2926catch (Exception ex) when (ex is ArgumentException || ex is InvalidOperationException) 3619catch (Exception ex) 3703catch (Exception ex) when (!ExceptionHandling.NotExpectedFunctionException(ex)) 3757catch (Exception) 4262private object LateBindExecute(Exception ex, BindingFlags bindingFlags, object objectInstance /* null unless instance method */, object[] args, bool isConstructor)
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileMatcher.cs (2)
2014catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2610catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FrameworkLocationHelper.cs (1)
988catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Graph\GraphBuildResult.cs (2)
30internal GraphBuildResult(int submissionId, Exception exception) 50public override Exception? Exception { get; internal set; }
Graph\GraphBuildSubmission.cs (1)
71protected internal override GraphBuildResult CreateFailedResult(Exception exception)
Graph\ParallelWorkSet.cs (3)
40private readonly List<Exception> _exceptions = new List<Exception>(0); 196catch (Exception ex)
Instance\HostObjectException.cs (2)
40Exception innerException) : 61internal HostObjectException(string message, Exception innerException)
Instance\HostServices.cs (1)
98catch (Exception ex) when (ex is COMException || ex is InvalidCastException)
Instance\TaskFactories\AssemblyTaskFactory.cs (4)
290foreach (Exception exception in e.LoaderExceptions) 305catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 441foreach (Exception exception in e.LoaderExceptions) 456catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e))
Instance\TaskFactories\TaskHostTask.cs (1)
215if (value is Exception ex)
Instance\TaskRegistry.cs (4)
1329catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1439foreach (Exception exception in e.LoaderExceptions) 1449catch (Exception e) when (!ExceptionHandling.NotExpectedReflectionException(e)) 1528catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
InterningBinaryReader.cs (1)
171catch (Exception e)
Logging\BinaryLogger\BinaryLogger.cs (3)
185catch (Exception) 214catch (Exception e) 463catch (Exception e)
Logging\BinaryLogger\BinaryLogReplayEventSource.cs (1)
123catch (Exception)
Logging\BinaryLogger\BuildEventArgsReader.cs (3)
237catch (Exception e) when ( 247Exception localException = e; 285void HandleError(FormatErrorMessage msgFactory, bool noThrow, ReaderErrorType readerErrorType, BinaryLogRecordKind recordKind, Exception? innerException = null)
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\InProcessConsoleConfiguration.cs (1)
37catch (Exception ex)
Logging\LoggerDescription.cs (1)
169catch (Exception e) // Wrap other exceptions in a more meaningful exception. LoggerException and InternalLoggerException are already meaningful.
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
91catch (Exception)
Logging\ProfilerLogger.cs (1)
300catch (Exception ex) when (ex is
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NativeWin32Exception.cs (3)
15/// associated recent error code (<see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error" />). The <see cref="Exception.Message" /> 29/// The exception's <see cref="Exception.Message" /> includes the error code, a system-provided message describing it, 42/// The exception's <see cref="Exception.Message" /> includes the error code and a system-provided message describing it.
NodeEndpointOutOfProcBase.cs (5)
473catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 508catch (Exception) 558catch (Exception e) 602catch (Exception e) 651catch (Exception e)
NodeShutdown.cs (3)
46private Exception _exception; 59public NodeShutdown(NodeShutdownReason reason, Exception e) 95public Exception Exception
OutOfProcTaskHostTaskResult.cs (4)
39internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException) 48internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 57internal OutOfProcTaskHostTaskResult(TaskCompleteType result, IDictionary<string, Object> finalParams, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 111public Exception TaskException
PrintLineDebuggerWriters.cs (1)
30catch (Exception e)
ProjectFileErrorUtilities.cs (3)
48Exception innerException, 127/// <param name="innerException">The inner <see cref="Exception"/>.</param> 134Exception innerException,
RegisteredTaskObjectCacheBase.cs (1)
151catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
TaskHostTaskComplete.cs (2)
68private Exception _taskException; 159public Exception TaskException
TaskLoggingHelper.cs (8)
527public static string GetInnerExceptionMessageString(Exception e) 530Exception excep = e; 898public void LogErrorFromException(Exception exception) 910public void LogErrorFromException(Exception exception, bool showStackTrace) 925public void LogErrorFromException(Exception exception, bool showStackTrace, bool showDetail, string file) 934foreach (Exception innerException in aggregateException.Flatten().InnerExceptions) 1265public void LogWarningFromException(Exception exception) 1277public void LogWarningFromException(Exception exception, bool showStackTrace)
TaskParameter.cs (3)
107if (wrappedParameter is Exception) 253Exception exceptionParam = (Exception)_wrappedParameter;
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ToolsetElement.cs (1)
101catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Utilities\NuGetFrameworkWrapper.cs (1)
247catch (Exception 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)) 174catch (Exception ex) 213catch (Exception ex) when (!ExceptionHandling.NotExpectedRegistryException(ex))
Utilities\SimpleVersion.cs (1)
188private static Exception InvalidVersionFormat()
Xml\ProjectXmlUtilities.cs (1)
28internal UnbuildableProjectTypeException(string message, Exception inner)
Microsoft.Build.CommandLine.UnitTests (2)
NodeStatus_Transition_Tests.cs (1)
133catch (Exception ex)
XMake_Tests.cs (1)
2791catch (Exception)
Microsoft.Build.Engine.OM.UnitTests (31)
ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
PrintLineDebuggerWriters.cs (1)
30catch (Exception e)
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Microsoft.Build.Engine.UnitTests (96)
BackEnd\BinaryTranslator_Tests.cs (17)
187Exception value = new ArgumentNullException("The argument was null"); 190Exception deserializedValue = null; 199Exception value = null; 205catch (Exception e) 212Exception deserializedValue = null; 221Exception value = null; 226catch (Exception e) 232catch (Exception exception) 241Exception deserializedValue = null; 261Exception e = (Exception)Activator.CreateInstance( 267Exception remote; 272catch (Exception exception) 280Exception deserializedValue = null; 289Exception value = null; 294catch (Exception e) 301Exception deserializedValue = null;
BackEnd\BuildManager_Tests.cs (3)
4074Exception exception = null; 4131catch (Exception e) 4172catch (Exception e)
BackEnd\BuildRequestEngine_Tests.cs (2)
271private Exception _engineException_Exception; 602private void Engine_Exception(Exception e)
BackEnd\EventSourceSink_Tests.cs (26)
94List<Exception> exceptionList = new List<Exception>(); 99foreach (Exception exception in exceptionList) 175catch (Exception e) 185catch (Exception e) 193Exception[] exceptionArray = new Exception[] { new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions 196catch (Exception e) 204Exception[] exceptionArray1 = new Exception[] { new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions 207Exception[] exceptionArray2 = new Exception[] { ae1, new Exception() }; //// two non-critical exceptions (ae1 contains nested exceptions) 210catch (Exception e) 220catch (Exception e) 228Exception[] exceptionArray = new Exception[] { new OutOfMemoryException(), new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions, one critical 231catch (Exception e) 239Exception[] exceptionArray1 = new Exception[] { new OutOfMemoryException(), new IndexOutOfRangeException(), new Exception() }; //// two non-critical exceptions, one critical 242Exception[] exceptionArray2 = new Exception[] { ae1, new Exception() }; //// one critical one non-critical (ae1 contains nested critical exception) 245catch (Exception e) 258private static void RaiseExceptionInEventHandler(BuildEventArgs buildEventToRaise, Exception exceptionToRaise) 267catch (Exception e) 396private Exception _exceptionInHandlers; 423internal EventHandlerHelper(IEventSource source, Exception exceptionToThrow)
BackEnd\LoggingService_Tests.cs (4)
1128catch (Exception e) 1189internal BaseFLThrowException(bool throwOnShutdown, bool throwOnInitialize, Exception exception) 1281internal LoggerThrowException(bool throwOnShutdown, bool throwOnInitialize, Exception exception) 1335protected Exception ExceptionToThrow
BackEnd\LoggingServicesLogMethod_Tests.cs (5)
287Exception exception = new Exception("SuperException"); 311Exception exception = new Exception("SuperException"); 347Exception exception = new Exception("SuperException"); 553Exception exception = new Exception("SuperException"); 1323private void GenerateMessageFromExceptionAndResource(Exception exception, string resourceName, out string code, out string helpKeyword, out string message, params string[] parameters)
BackEnd\MockLoggingService.cs (4)
419public void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file) 431public void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName) 443public void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) 454public void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName)
BackEnd\RequestBuilder_Tests.cs (1)
42public void LoggingException(Exception e)
BackEnd\SdkResolverLoader_Tests.cs (5)
19using Exception = System.Exception; 144Exception innerException = exception.InnerException.ShouldBeOfType<Exception>(); 207Exception innerException = exception.InnerException.ShouldBeOfType<Exception>();
BackEnd\SdkResolverService_Tests.cs (1)
155catch (Exception e)
BackEnd\TargetBuilder_Tests.cs (2)
57public void LoggingException(Exception e) 1669catch (Exception ex) when (retries < 4)
BackEnd\TargetEntry_Tests.cs (1)
49public void LoggingException(Exception e)
BackEnd\TaskHostTaskComplete_Tests.cs (2)
239private void AssertInvalidConstructorThrows(Type expectedExceptionType, TaskCompleteType taskResult, Exception taskException, string taskExceptionMessage, string[] taskExceptionMessageArgs, IDictionary<string, object> taskOutputParameters, IDictionary<string, string> buildProcessEnvironment) 252catch (Exception e)
BackEnd\TaskThatThrows.cs (4)
26Type exceptionType = string.IsNullOrWhiteSpace(ExceptionType) ? typeof(Exception) : Type.GetType(ExceptionType) ?? typeof(Exception); 29Exception exceptionInstance = (Exception)(ctor?.Invoke([exceptionMessage]) ?? new Exception(exceptionMessage));
BackEnd\TranslationHelpers.cs (2)
89internal static bool CompareExceptions(Exception left, Exception right, out string diffReason, bool detailed = false)
BuildEnvironmentHelper_Tests.cs (2)
490catch (Exception) 534catch (Exception)
BuildResultUtilities.cs (1)
45public static WorkUnitResult GetStopWithErrorResult(Exception e)
Collections\CopyOnWritePropertyDictionary_Tests.cs (2)
64Assert.ThrowsAny<Exception>(() => dic["a"] = null!); 67Assert.ThrowsAny<Exception>(() => dic["a"] = b);
Construction\SolutionFile_OldParser_Tests.cs (1)
926catch (Exception ex)
Definition\ToolsetConfigurationReaderTestHelper.cs (2)
22private static Exception s_exceptionToThrow = null; 29internal static string WriteConfigFile(string content, Exception exception)
FileMatcher_Tests.cs (1)
598catch (Exception)
FileUtilities_Tests.cs (1)
180catch (Exception e)
Graph\GraphLoadedFromSolution_tests.cs (2)
503Exception exception = null; 511catch (Exception e)
Graph\ParallelWorkSet_Tests.cs (2)
241List<Exception> observedExceptions = new(); 253catch (Exception ex)
PrintLineDebugger_Tests.cs (3)
208Should.Throw<Exception>( 231Should.Throw<Exception>( 252Should.Throw<Exception>(
Microsoft.Build.Framework (40)
ArraySortHelper.cs (7)
41catch (Exception e) 54catch (Exception e) 74catch (Exception e) 330catch (Exception e) 351catch (Exception e) 681catch (Exception e) 936catch (Exception e)
BinaryTranslator.cs (2)
512public void TranslateException(ref Exception value) 1213public void TranslateException(ref Exception value)
BuildException\BuildExceptionBase.cs (4)
29Exception? inner) 73internal static void WriteExceptionToTranslator(ITranslator translator, Exception exception) 116internal static Exception ReadExceptionFromTranslator(ITranslator translator) 119Exception? innerException = null;
BuildException\BuildExceptionSerializationHelper.cs (9)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 21public Func<string, Exception?, BuildExceptionBase> Factory { get; } 24private static Dictionary<string, Func<string, Exception?, BuildExceptionBase>>? s_exceptionFactories; 26private static readonly Func<string, Exception?, BuildExceptionBase> s_defaultFactory = 33type.IsSubclassOf(typeof(Exception)) && 49var exceptionFactories = new Dictionary<string, Func<string, Exception?, BuildExceptionBase>>(); 54Func<string, Exception?, BuildExceptionBase> exceptionFactory = typeConstructionTuple.Factory; 76internal static Func<string, Exception?, BuildExceptionBase> CreateExceptionFactory(string serializationType) 78Func<string, Exception?, BuildExceptionBase>? factory = null;
BuildException\GenericBuildTransferredException.cs (1)
19Exception? inner)
ChangeWaves.cs (1)
200catch (Exception)
CriticalTaskException.cs (2)
21Exception innerException) 26internal CriticalTaskException(string message, Exception? inner)
EncodingUtilities.cs (2)
281catch (Exception ex) when (ex is IOException || ex is SecurityException) 307catch (Exception ex) when (ex is SecurityException or ObjectDisposedException)
ErrorUtilities.cs (1)
53internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args)
InternalErrorException.cs (4)
48Exception innerException) : 52internal static InternalErrorException CreateFromRemote(string message, Exception innerException) 57private InternalErrorException(string message, Exception innerException, bool calledFromDeserialization) 111private static void ConsiderDebuggerLaunch(string message, Exception innerException)
ITaskItemExtensions.cs (1)
56catch (Exception e)
ITranslator.cs (1)
270void TranslateException(ref Exception value);
LazyFormattedBuildEventArgs.cs (1)
126catch (Exception e)
LoggerException.cs (2)
55public LoggerException(string message, Exception innerException) 69public LoggerException(string message, Exception innerException, string errorCode, string helpKeyword)
Telemetry\BuildCheckTelemetry.cs (1)
23Exception exception)
ThrowHelper.cs (1)
163internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
Microsoft.Build.Tasks.CodeAnalysis (29)
CopyRefAssembly.cs (3)
49catch (Exception e) 72catch (Exception) 89catch (Exception e)
Csc.cs (2)
533catch (Exception e) 667catch (Exception e)
ManagedCompiler.cs (1)
575catch (Exception e)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (4)
57internal static void LogException(this ICompilerServerLogger logger, Exception exception, string reason) 69Exception? e = exception.InnerException; 80void AppendException(Exception exception) 136catch (Exception e)
src\Compilers\Shared\BuildServerConnection.cs (11)
129catch (Exception) 141catch (Exception) 289catch (Exception e) 314catch (Exception e) 358catch (Exception e) 402catch (Exception e) when (e is IOException || e is TimeoutException) 428catch (Exception e) when (!(e is TaskCanceledException || e is OperationCanceledException)) 727catch (Exception) 774catch (Exception) 806catch (Exception) 825catch (Exception)
Utilities.cs (6)
118catch (Exception e) when (IsIoRelatedException(e)) { } 128catch (Exception e) when (IsIoRelatedException(e)) { } 131internal static bool IsIoRelatedException(Exception e) => 138internal static Exception GetLocalizedArgumentException(Exception e, 145internal static Exception GetLocalizedArgumentException(string errorString,
Vbc.cs (2)
332catch (Exception e) when (Utilities.IsIoRelatedException(e)) 961catch (Exception e)
Microsoft.Build.Tasks.Core (175)
AddToWin32Manifest.cs (1)
148catch (Exception ex)
AppConfig\AppConfig.cs (1)
55catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
AppConfig\AppConfigException.cs (1)
59public AppConfigException(string message, string fileName, int line, int column, System.Exception inner) : base(message, inner)
AppConfig\BindingRedirect.cs (2)
59catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 73catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
AssemblyDependency\BadImageReferenceException.cs (1)
20internal BadImageReferenceException(string message, Exception innerException)
AssemblyDependency\DependencyResolutionException.cs (1)
20internal DependencyResolutionException(string message, Exception innerException)
AssemblyDependency\GenerateBindingRedirects.cs (1)
377catch (Exception)
AssemblyDependency\Reference.cs (5)
48private List<Exception> _errors = new List<Exception>(); 222_errors = new List<Exception>(); 397internal void AddError(Exception e) 410internal List<Exception> GetErrors()
AssemblyDependency\ReferenceResolutionException.cs (1)
20internal ReferenceResolutionException(string message, Exception innerException)
AssemblyDependency\ReferenceTable.cs (9)
513List<Exception> exceptions) 531Exception e = SetPrimaryAssemblyReferenceItem(n); 546private Exception SetPrimaryAssemblyReferenceItem( 672catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 895catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 986catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1200catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1616List<Exception> exceptions) 2965catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
AssemblyDependency\ResolveAssemblyReference.cs (14)
1067List<Exception> generalResolutionExceptions) 1261foreach (Exception error in generalResolutionExceptions) 1501catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1687List<Exception> itemErrors = reference.GetErrors(); 1688foreach (Exception itemError in itemErrors) 2220List<Exception> inclusionListErrors = new List<Exception>(); 2288Exception e = redistList.Errors[i]; 2298Exception e = inclusionListErrors[i]; 2421var generalResolutionExceptions = new List<Exception>(); 2693catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2782List<Exception> inclusionListErrors = new List<Exception>(); 2804Exception e = fullFrameworkRedistList.Errors[i];
AssemblyDependency\Resolver.cs (1)
327catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
AssignCulture.cs (1)
209catch (Exception e)
BootstrapperUtil\BootstrapperBuilder.cs (1)
247catch (Exception ex)
Copy.cs (2)
889catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 919catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
CreateManifestResourceName.cs (1)
243catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Delete.cs (2)
147catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 178private void LogError(ITaskItem file, Exception e, string lockedFileMessage)
DownloadFile.cs (5)
110catch (Exception e) 112bool canRetry = IsRetriable(e, out Exception actualException) && retryAttemptCount++ < Retries; 239private static bool IsRetriable(Exception exception, out Exception actualException) 339public CustomHttpRequestException(string message, Exception inner, HttpStatusCode statusCode)
ErrorFromResources.cs (1)
60catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileIO\ReadLinesFromFile.cs (1)
67catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
FileIO\WriteLinesToFile.cs (1)
150catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
FileMatcher.cs (2)
2014catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2610catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FileState.cs (2)
72private readonly Exception _exceptionThrown; 168catch (Exception ex)
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
GenerateApplicationManifest.cs (1)
477catch (Exception ex)
GenerateManifestBase.cs (2)
457catch (Exception ex) 620catch (Exception ex)
GenerateResource.cs (14)
1544catch (Exception e) when (!ExceptionHandling.NotExpectedIoOrXmlException(e) || e is MSBuildResXException) 1638catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2636catch (Exception e) when ( 2651catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2740catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2786catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 2793catch (Exception e) when ( 2808catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2895catch (Exception deleteException) 3528catch (Exception e) when 3763Exception capturedException = null; 3771catch (Exception e) 3787catch (Exception) { } // We aggressively catch all exception types since we already have one we will throw. 3791catch (Exception) { } // We aggressively catch all exception types since we already have one we will throw.
GetAssemblyIdentity.cs (1)
71catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
GetInstalledSDKLocations.cs (1)
150catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
GetReferenceAssemblyPaths.cs (1)
217catch (Exception e)
GetSDKReferenceFiles.cs (6)
290catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 940catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 970catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 983catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 1105catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 1139catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
InterningBinaryReader.cs (1)
171catch (Exception e)
InvalidParameterValueException.cs (1)
31internal InvalidParameterValueException(string paramName, string actualValue, string message, Exception innerException)
ListOperators\FindUnderPath.cs (2)
65catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 85catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
MakeDir.cs (1)
80catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
ManifestUtil\DeployManifest.cs (1)
229catch (Exception)
ManifestUtil\LauncherBuilder.cs (2)
73catch (Exception ex) 95catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ManifestUtil\Manifest.cs (2)
583catch (Exception e) 600catch (Exception e)
ManifestUtil\MetadataReader.cs (1)
48catch (Exception)
ManifestUtil\SecurityUtil.cs (1)
742catch (Exception ex)
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Move.cs (1)
170catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NativeMethods.cs (1)
1311catch (Exception e)
NativeWin32Exception.cs (3)
15/// associated recent error code (<see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error" />). The <see cref="Exception.Message" /> 29/// The exception's <see cref="Exception.Message" /> includes the error code, a system-provided message describing it, 42/// The exception's <see cref="Exception.Message" /> includes the error code and a system-provided message describing it.
PrintLineDebuggerWriters.cs (1)
30catch (Exception e)
RedistList.cs (7)
74private readonly ReadOnlyCollection<Exception> _errors; 93var errors = new List<Exception>(); 108_errors = new ReadOnlyCollection<Exception>(errors); 132internal Exception[] Errors => _errors.ToArray(); 523internal Dictionary<string, string> GenerateDenyList(AssemblyTableInfo[] allowListAssemblyTableInfo, List<Exception> allowListErrors, List<string> allowListErrorFileNames) 649internal static string ReadFile(AssemblyTableInfo assemblyTableInfo, List<AssemblyEntry> assembliesList, List<Exception> errorsList, List<string> errorFilenamesList, List<AssemblyRemapping> remapEntries) 704catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
RemoveDir.cs (2)
135catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 173catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
ResourceHandling\InputFormatNotSupportedException.cs (1)
22public InputFormatNotSupportedException(string message, Exception innerException) : base(message, innerException)
ResourceHandling\MSBuildResXException.cs (1)
22public MSBuildResXException(string message, Exception innerException) : base(message, innerException)
ResourceHandling\MSBuildResXReader.cs (1)
50catch (Exception e)
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (2)
310catch (Exception e) 770catch (Exception e)
StateFileBase.cs (3)
63catch (Exception e) when (!ExceptionHandling.NotExpectedSerializationException(e)) 117catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 146catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
Touch.cs (4)
176catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 248catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 264catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 280catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
Unzip.cs (5)
92catch (Exception e) 126catch (Exception e) 140catch (Exception e) 210catch (Exception e) 222catch (Exception e)
WriteCodeFragment.cs (3)
120catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 548catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex)) 576catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
XmlPeek.cs (4)
72catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 87catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 104catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 117catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
XmlPoke.cs (4)
75catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 89catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 103catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 130catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
XslTransformation.cs (4)
108catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 135catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 153catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 180catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
ZipDirectory.cs (2)
68catch (Exception e) 89catch (Exception e)
Microsoft.Build.Tasks.UnitTests (13)
Copy_Tests.cs (1)
2635catch (Exception)
GetInstalledSDKLocations_Tests.cs (2)
102catch (Exception) 139catch (Exception)
MockFaultInjectionHelper.cs (2)
14private Exception _exceptionToThrow; 20public void InjectFailure(FailurePointEnum failureToInject, Exception exceptionToThrow)
NativeMethodsShared_Tests.cs (1)
143catch (Exception e)
PrintLineDebugger_Tests.cs (3)
208Should.Throw<Exception>( 231Should.Throw<Exception>( 252Should.Throw<Exception>(
XslTransformation_Tests.cs (4)
591catch (Exception e) 742catch (Exception e) 775catch (Exception e) 840catch (Exception e)
Microsoft.Build.UnGAC (1)
Program.cs (1)
54catch (Exception e)
Microsoft.Build.UnitTests.Shared (9)
DummyMappedDrive.cs (3)
47Exception? e = null; 54catch (Exception exc) 67catch (Exception exc)
ObjectModelHelpers.cs (6)
892catch (Exception ex) when (retries < 4) 930catch (Exception ex) when (retries < 4) 1881Exception ex1 = null; 1882Exception ex2 = null; 1888catch (Exception ex) 1897catch (Exception ex)
Microsoft.Build.Utilities.Core (77)
ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileMatcher.cs (2)
2014catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 2610catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
FrameworkLocationHelper.cs (1)
988catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
LockCheck.cs (2)
279catch (Exception) 377private static Exception GetException(int res, string apiName, string message)
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
MuxLogger.cs (15)
653catch (Exception) 698catch (Exception) 741catch (Exception) 781catch (Exception) 826catch (Exception) 884catch (Exception) 926catch (Exception) 968catch (Exception) 1010catch (Exception) 1052catch (Exception) 1094catch (Exception) 1136catch (Exception) 1183catch (Exception) 1242catch (Exception) 1288catch (Exception)
NativeWin32Exception.cs (3)
15/// associated recent error code (<see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error" />). The <see cref="Exception.Message" /> 29/// The exception's <see cref="Exception.Message" /> includes the error code, a system-provided message describing it, 42/// The exception's <see cref="Exception.Message" /> includes the error code and a system-provided message describing it.
PlatformManifest.cs (1)
156catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
PrintLineDebuggerWriters.cs (1)
30catch (Exception e)
SDKManifest.cs (1)
358catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
TaskLoggingHelper.cs (8)
527public static string GetInnerExceptionMessageString(Exception e) 530Exception excep = e; 898public void LogErrorFromException(Exception exception) 910public void LogErrorFromException(Exception exception, bool showStackTrace) 925public void LogErrorFromException(Exception exception, bool showStackTrace, bool showDetail, string file) 934foreach (Exception innerException in aggregateException.Flatten().InnerExceptions) 1265public void LogWarningFromException(Exception exception) 1277public void LogWarningFromException(Exception exception, bool showStackTrace)
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ToolLocationHelper.cs (7)
861catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1058catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1178catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1467catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 3073catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 3168catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 3216catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
ToolsetElement.cs (1)
101catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
ToolTask.cs (4)
858catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1328catch (Exception) 1567catch (Exception e) 1605catch (Exception e) when (e is Win32Exception || e is IOException || e is UnauthorizedAccessException)
Microsoft.Build.Utilities.UnitTests (11)
NativeMethodsShared_Tests.cs (1)
143catch (Exception e)
PrintLineDebugger_Tests.cs (3)
208Should.Throw<Exception>( 231Should.Throw<Exception>( 252Should.Throw<Exception>(
TaskItem_Tests.cs (2)
140catch (Exception e) 160catch (Exception e)
TaskLoggingHelper_Tests.cs (3)
226catch (Exception e) 250Exception inner = new InvalidOperationException(); 253catch (Exception e)
ToolLocationHelper_Tests.cs (2)
4531catch (Exception) 4566catch (Exception)
Microsoft.CodeAnalysis (224)
CommandLine\CommandLineArguments.cs (1)
435catch (Exception e) when (diagnosticsOpt != null && (e is BadImageFormatException || e is IOException))
CommandLine\CommandLineParser.cs (3)
293catch (Exception) 639catch (Exception) 1198catch (Exception)
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (3)
41catch (Exception e) 103catch (Exception e) 115private void ReportOpenFileDiagnostic(DiagnosticBag diagnostics, Exception e)
CommandLine\CommonCompiler.cs (9)
285catch (Exception e) 377catch (Exception e) 417catch (Exception e) 505internal static DiagnosticInfo ToFileReadDiagnostics(CommonMessageProvider messageProvider, Exception e, string filePath) 1360catch (Exception e) 1587catch (Exception e) 1631catch (Exception e) 1672catch (Exception ex) 1706catch (Exception ex)
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (1)
63catch (Exception e) when (e is BadImageFormatException || e is IOException)
CommandLine\NoThrowStreamDisposer.cs (1)
65catch (Exception e)
Compilation\Compilation.cs (1)
2108catch (Exception ex)
Compilation\SourceReferenceResolver.cs (1)
46/// <exception cref="IOException">Error reading file <paramref name="resolvedPath"/>. See <see cref="Exception.InnerException"/> for details.</exception>
Compilation\XmlReferenceResolver.cs (1)
36/// <exception cref="IOException">Error reading file <paramref name="resolvedPath"/>. See <see cref="Exception.InnerException"/> for details.</exception>
Diagnostic\CommonMessageProvider.cs (1)
255public void ReportStreamWriteException(Exception e, string filePath, DiagnosticBag diagnostics)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
103catch (Exception)
Diagnostic\LocalizableString.cs (5)
19public event EventHandler<Exception>? OnException; 30catch (Exception ex) 63catch (Exception ex) 76catch (Exception ex) 109private void RaiseOnException(Exception ex)
DiagnosticAnalyzer\AnalysisValueProvider.cs (1)
58catch (Exception)
DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (1)
117catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (2)
177catch (Exception ex) 419catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Diagnostic))
DiagnosticAnalyzer\AnalyzerDriver.cs (9)
490Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> newOnAnalyzerException = (ex, analyzer, diagnostic, cancellationToken) => 720var innerException = faultedTask.Exception?.InnerException; 824Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = 827Func<Exception, bool>? nullFilter = null; 837Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 838Func<Exception, bool>? analyzerExceptionFilter, 1569catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 1628catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 2740catch (Exception ex) when (ex is InsufficientExecutionStackException)
DiagnosticAnalyzer\AnalyzerExecutor.cs (18)
38private readonly Func<Exception, bool>? _analyzerExceptionFilter; 102Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 103Func<Exception, bool>? analyzerExceptionFilter, 134Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 135Func<Exception, bool>? analyzerExceptionFilter, 178internal Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> OnAnalyzerException { get; } 1211catch (Exception ex) when (HandleAnalyzerException(analyzer, ex, info) && 1217private bool HandleAnalyzerException(DiagnosticAnalyzer analyzer, Exception ex, in AnalysisContextInfo? info) 1230Exception exception, 1233Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 1234Func<Exception, bool>? analyzerExceptionFilter, 1248catch (Exception) 1255static bool ExceptionFilter(Exception ex, Func<Exception, bool>? analyzerExceptionFilter, CancellationToken cancellationToken) 1271internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e, AnalysisContextInfo? info = null) 1282private static string CreateDiagnosticDescription(AnalysisContextInfo? info, Exception e) 1307catch (Exception ex) 1320internal static Diagnostic CreateDriverExceptionDiagnostic(Exception e)
DiagnosticAnalyzer\AnalyzerFileReference.cs (5)
200private static AnalyzerLoadFailureEventArgs CreateAnalyzerFailedArgs(Exception e, string? typeName = null) 481catch (Exception e) 532catch (Exception e) 600catch (Exception e) 628catch (Exception e)
DiagnosticAnalyzer\AnalyzerLoadFailureEventArgs.cs (2)
39public Exception? Exception { get; } 46public AnalyzerLoadFailureEventArgs(FailureErrorCode errorCode, string message, Exception? exceptionOpt = null, string? typeNameOpt = null)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (7)
25private static ImmutableDictionary<LocalizableString, Exception?> s_localizableStringToException = ImmutableDictionary<LocalizableString, Exception?>.Empty.WithComparers(Roslyn.Utilities.ReferenceEqualityComparer.Instance); 336var exception = getAndCacheToStringException(localizableString); 344static Exception? getAndCacheToStringException(LocalizableString localizableString) 351static Exception? computeException(LocalizableString localizableString) 353Exception? localException = null; 354EventHandler<Exception> handler = (_, ex) => localException = ex;
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (6)
807catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 1221Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException = null) 1232Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> wrappedOnAnalyzerException = 1241catch (Exception ex) when (AnalyzerExecutor.HandleAnalyzerException(ex, analyzer, info: null, wrappedOnAnalyzerException, analyzerExceptionFilter: null, CancellationToken.None)) 1253catch (Exception ex) when (AnalyzerExecutor.HandleAnalyzerException(ex, suppressor, info: null, wrappedOnAnalyzerException, analyzerExceptionFilter: null, CancellationToken.None)) 1287catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (8)
15private readonly Action<Exception, DiagnosticAnalyzer, Diagnostic>? _onAnalyzerException; 16private readonly Func<Exception, bool>? _analyzerExceptionFilter; 29public Action<Exception, DiagnosticAnalyzer, Diagnostic>? OnAnalyzerException => _onAnalyzerException; 34public Func<Exception, bool>? AnalyzerExceptionFilter => _analyzerExceptionFilter; 60Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 77Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 96Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 100Func<Exception, bool>? analyzerExceptionFilter)
DiagnosticAnalyzer\ShadowCopyAnalyzerAssemblyLoader.cs (1)
191catch (Exception ex)
DiaSymReader\SymUnmanagedFactory.cs (3)
166internal static object CreateObject(bool createReader, bool useAlternativeLoadPath, bool useComRegistry, out string moduleName, out Exception loadException) 211catch (Exception e) 233catch (Exception e)
DiaSymReader\Writer\SymUnmanagedWriterException.cs (3)
29public SymUnmanagedWriterException(string message, Exception innerException) 34public SymUnmanagedWriterException(string message, Exception innerException, string implementationModuleName) 40internal SymUnmanagedWriterException(Exception innerException, string implementationModuleName)
DiaSymReader\Writer\SymUnmanagedWriterFactory.cs (2)
46loadException: out var loadException); 88catch (Exception e)
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (30)
50private Exception PdbWritingException(Exception inner) 71catch (Exception ex) 114catch (Exception ex) 165catch (Exception ex) 184catch (Exception ex) 202catch (Exception ex) 242catch (Exception ex) 256catch (Exception ex) 270catch (Exception ex) 284catch (Exception ex) 298catch (Exception ex) 313catch (Exception ex) 339catch (Exception ex) 354catch (Exception ex) 422catch (Exception ex) 473catch (Exception ex) 518catch (Exception ex) 533catch (Exception ex) 571catch (Exception ex) 585catch (Exception ex) 599catch (Exception ex) 626catch (Exception ex) 653catch (Exception ex) 667catch (Exception ex) 692catch (Exception ex) 706catch (Exception ex) 733catch (Exception ex) 745catch (Exception ex) 787catch (Exception ex)
Emit\EditAndContinue\DefinitionMap.cs (3)
294catch (Exception e) when (e is InvalidDataException or IOException or BadImageFormatException) 379catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException || e is IOException) 695catch (Exception e) when (e is InvalidDataException or IOException or BadImageFormatException)
FileSystem\FileUtilities.cs (8)
204catch (Exception) 303catch (Exception e) 327catch (Exception e) when (e is not IOException) 344catch (Exception e) when (e is not IOException) 386catch (Exception e) 404catch (Exception e) 423catch (Exception e) 448catch (Exception e)
FileSystem\ICommonCompilerFileSystem.cs (1)
46catch (Exception e)
FileSystem\PathUtilities.cs (1)
774catch (Exception ex) when (
InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
InternalUtilities\FatalError.cs (11)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
InternalUtilities\RoslynParallel.cs (1)
32catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
InternalUtilities\StringExtensions.cs (1)
293catch (Exception ex)
InternalUtilities\XmlUtilities.cs (1)
85catch (Exception e) when (e.GetType().FullName == "System.Xml.XPath.XPathException")
MetadataReader\MetadataDecoder.cs (2)
1672catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException) 1809catch (Exception e) when ((e is UnsupportedSignatureContent || e is BadImageFormatException) && !isFunctionPointerSignature)
MetadataReader\PEModule.cs (3)
1379catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { } 1436catch (Exception ex) when (ex is BadImageFormatException or UnsupportedSignatureContent) 1544catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { }
MetadataReference\AssemblyMetadata.cs (5)
160/// <exception cref="IOException">Error reading file <paramref name="path"/>. See <see cref="Exception.InnerException"/> for details.</exception> 277/// <exception cref="IOException">IO error reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 303/// <exception cref="IOException">IO error while reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 311/// <exception cref="IOException">IO error while reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 406/// <exception cref="IOException">IO error reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception>
MetadataReference\ModuleMetadata.cs (1)
257/// <exception cref="IOException">Error opening file <paramref name="path"/>. See <see cref="Exception.InnerException"/> for details.</exception>
MetadataReference\PortableExecutableReference.cs (1)
186internal static Diagnostic ExceptionToDiagnostic(Exception e, CommonMessageProvider messageProvider, Location location, string display, MetadataImageKind kind)
NativePdbWriter\PdbWriter.cs (1)
757catch (Exception e)
PEWriter\ManagedResource.cs (1)
66catch (Exception e)
PEWriter\MetadataWriter.cs (2)
1748catch (Exception e) when (!(e is OperationCanceledException)) 1767catch (Exception e) when (!(e is OperationCanceledException))
PEWriter\MetadataWriter.PortablePdb.cs (1)
857catch (Exception e) when (!(e is OperationCanceledException))
PEWriter\PeWriter.cs (3)
29public PeWritingException(Exception inner) 230catch (Exception e) when (!(e is OperationCanceledException)) 307catch (Exception e) when (!(e is OperationCanceledException))
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
503catch (Exception e) when (e is BadImageFormatException || e is IOException)
ResourceDescription.cs (1)
124catch (Exception ex)
ResourceException.cs (1)
11internal ResourceException(string? name, Exception? inner = null)
RuleSet\InvalidRuleSetException.cs (1)
18public InvalidRuleSetException(string message, Exception inner) : base(message, inner) { }
RuleSet\RuleSetInclude.cs (1)
69catch (Exception e)
RuleSet\RuleSetProcessor.cs (1)
75catch (Exception e)
SourceGeneration\GeneratorDriver.cs (5)
249Exception? ex = null; 254catch (Exception e) when (handleGeneratorException(compilation, MessageProvider, sourceGenerator, e, isInit: true)) 339static bool handleGeneratorException(Compilation compilation, CommonMessageProvider messageProvider, ISourceGenerator sourceGenerator, Exception e, bool isInit) 381private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState, ISourceGenerator generator, Exception e, DiagnosticBag? diagnosticBag, CancellationToken cancellationToken, TimeSpan? runTime = null, bool isInit = false) 399private static Diagnostic CreateGeneratorExceptionDiagnostic(CommonMessageProvider provider, ISourceGenerator generator, Exception e, bool isInit)
SourceGeneration\GeneratorState.cs (3)
58Exception? exception, 93public GeneratorState WithError(Exception exception, Diagnostic error, TimeSpan elapsedTime) 117internal Exception? Exception { get; }
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (2)
48catch (Exception e) 85catch (Exception e) when (!ExceptionUtilities.IsCurrentOperationBeingCancelled(e, cancellationToken))
SourceGeneration\Nodes\TransformNode.cs (1)
85catch (Exception e) when (_wrapUserFunc && !ExceptionUtilities.IsCurrentOperationBeingCancelled(e, cancellationToken))
SourceGeneration\RunResults.cs (3)
88Exception? exception, 131/// An <see cref="System.Exception"/> instance that was thrown by the generator, or <c>null</c> if the generator completed without error. 137public Exception? Exception { get; }
SourceGeneration\SyntaxStore.cs (2)
31private readonly ImmutableDictionary<SyntaxInputNode, Exception>.Builder _syntaxExceptions = ImmutableDictionary.CreateBuilder<SyntaxInputNode, Exception>();
SourceGeneration\UserFunction.cs (7)
16public new Exception InnerException => base.InnerException!; 18public UserFunctionException(Exception innerException) 41catch (Exception e) 53catch (Exception e) 70catch (Exception e) when (catchAnalyzerExceptions && !ExceptionUtilities.IsCurrentOperationBeingCancelled(e, token)) 90catch (Exception e) when (catchAnalyzerExceptions && !ExceptionUtilities.IsCurrentOperationBeingCancelled(e, token)) 105catch (Exception e) when (catchAnalyzerExceptions && !ExceptionUtilities.IsCurrentOperationBeingCancelled(e, token))
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
18public static string CreateDiagnosticDescription(this Exception exception) 34private static string GetExceptionMessage(Exception exception)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (7)
43catch (Exception e) 56catch (Exception e) 76catch (Exception e) 333catch (Exception e) 354catch (Exception e) 683catch (Exception e) 936catch (Exception e)
src\Dependencies\Collections\Internal\ThrowHelper.cs (1)
177internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
StrongName\CryptoBlobParser.cs (1)
247catch (Exception)
StrongName\DesktopStrongNameProvider.cs (5)
85catch (Exception ex) 102catch (Exception ex) 156catch (Exception ex) 237catch (Exception ex) 259catch (Exception ex)
Microsoft.CodeAnalysis.CodeStyle (57)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
67catch (Exception ex)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (8)
204catch (Exception) 303catch (Exception e) 327catch (Exception e) when (e is not IOException) 344catch (Exception e) when (e is not IOException) 386catch (Exception e) 404catch (Exception e) 423catch (Exception e) 448catch (Exception e)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
774catch (Exception ex) when (
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
293catch (Exception ex)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (7)
43catch (Exception e) 56catch (Exception e) 76catch (Exception e) 333catch (Exception e) 354catch (Exception e) 683catch (Exception e) 936catch (Exception e)
src\Dependencies\Collections\Internal\ThrowHelper.cs (1)
177internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
28/// <exception cref="Exception">
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (1)
79=> compilation.GetTypeByMetadataName(typeof(Exception).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
293catch (Exception ex) 447catch (Exception e) when (FatalError.ReportAndPropagate(e))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EventMap.cs (1)
174catch (Exception e) when (FatalError.ReportAndPropagate(e))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (2)
313Exception? exception = null; 324catch (Exception ex) when ((exception = ex) == null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (9)
169catch (Exception e) 184catch (Exception e) 205catch (Exception e) 334catch (Exception e) 349catch (Exception e) 370catch (Exception e) 411private List<Exception> _exceptions; 504public void RecordException(Exception e) 509(_exceptions ??= new List<Exception>()).Add(e);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SoftCrashException.cs (2)
37public SoftCrashException(string message, Exception innerException) : base(message, innerException) { } 39public SoftCrashException(string message, Exception innerException, CancellationToken token) : base(message, innerException, token) { }
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
82private static Exception CreateDocumentNotFoundException()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
51catch (Exception)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
68List<Exception>? exceptions = null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefUtilities.cs (3)
14public static void DisposeWithExceptionTracking<T>(T instance, [NotNullIfNotNull("exceptions")] ref List<Exception>? exceptions) 21catch (Exception ex) when (FatalError.ReportAndCatch(ex)) 23exceptions ??= new List<Exception>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
85List<Exception>? exceptions = null;
Microsoft.CodeAnalysis.Collections.Package (8)
Internal\ArraySortHelper.cs (7)
43catch (Exception e) 56catch (Exception e) 76catch (Exception e) 333catch (Exception e) 354catch (Exception e) 683catch (Exception e) 936catch (Exception e)
Internal\ThrowHelper.cs (1)
177internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
Microsoft.CodeAnalysis.CSharp (9)
BoundTree\BoundTreeVisitors.cs (1)
167public CancelledByStackGuardException(Exception inner, BoundNode node)
CommandLine\CSharpCompiler.cs (1)
141catch (Exception ex)
Compilation\SyntaxAndDeclarationManager.cs (1)
263catch (Exception e)
Compiler\ClsComplianceChecker.cs (1)
220catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Compiler\DocumentationCommentCompiler.cs (1)
110catch (Exception e)
Compiler\MethodCompiler.cs (2)
395catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 441catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Symbols\Metadata\PE\MetadataDecoder.cs (1)
146catch (Exception e) when (FatalError.ReportAndPropagate(e)) // Trying to get more useful Watson dumps.
Symbols\Synthesized\RefKindVector.cs (1)
120catch (Exception)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
137catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.General))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
StringCopyPaste\StringCopyPasteData.cs (2)
34catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical)) 54catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
146var exceptions = new List<Exception>(); 151catch (Exception e)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (2)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (2)
165catch (Exception) 177catch (Exception)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenThrowTests.cs (2)
27var compilation = CompileAndVerifyException<Exception>(source, "TestThrowNewExpression"); 51var compilation = CompileAndVerifyException<Exception>(source, "TestThrowLocalExpression");
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\EditAndContinueTests.cs (1)
12775debugInformationProvider: _ => throw (Exception)Activator.CreateInstance(exceptionType, ["bug!"]))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (12)
Attributes\EmitTestStrongNameProvider.cs (2)
24var ex = new Exception("Crazy exception you could never have predicted!"); 46var ex = new Exception("Crazy exception you could never have predicted!");
Diagnostics\DiagnosticAnalyzerTests.cs (5)
878public Exception ThrownException { get; set; } 897catch (Exception e) 913Exception analyzerException = null; 953Exception analyzerException = null; 1021Exception analyzerException = null;
Diagnostics\DiagnosticSuppressorTests.cs (5)
393var exceptions = new List<Exception>(); 435var exceptions = new List<Exception>(); 486var exceptions = new List<Exception>(); 539var exceptions = new List<Exception>(); 592var exceptions = new List<Exception>();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (6)
EndToEndTests.cs (6)
39Exception exception = null; 46catch (Exception ex) 112catch (Exception) 201catch (Exception e) 206void testLimits(Exception innerException = null) 214catch (Exception e)
Microsoft.CodeAnalysis.CSharp.Features (18)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (1)
103catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
84catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
95catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
101catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
175catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
57catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
90catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
86catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
126catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
95catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
58catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
66catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
188catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken, ErrorSeverity.General))
Debugging\CSharpBreakpointResolutionService.cs (1)
48catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Debugging\CSharpProximityExpressionsService.cs (1)
97catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Debugging\DataTipInfoGetter.cs (1)
81catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (2)
209catchClause.Declaration.Type is IdentifierNameSyntax { Identifier.ValueText: nameof(Exception) }) 217Right: IdentifierNameSyntax { Identifier.ValueText: nameof(Exception) },
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Hosting\ObjectFormatter\CSharpObjectFormatter.cs (1)
24public override string FormatException(Exception e) => s_impl.FormatException(e);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (9)
InteractiveSessionTests.cs (1)
1483var value = CSharpScript.EvaluateAsync<IEnumerable<Exception>>(@"
ObjectFormatterTests.cs (7)
937catch (Exception e) 960catch (Exception e) 984catch (Exception e) 1008catch (Exception e) 1041catch (Exception e) 1082catch (Exception e) 1106catch (Exception e)
ScriptTests.cs (1)
1117catch (Exception ex)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (21)
Semantics\VarianceTests.cs (2)
124catch (Exception) 240catch (Exception)
SourceGeneration\GeneratorDriverTests.cs (3)
1567class ThrowWhenEqualsItem(Exception toThrow) 1569readonly Exception _toThrow = toThrow; 4258bool initialization = false) where T : Exception
SourceGeneration\SyntaxAwareGeneratorTests.cs (16)
375var exception = new Exception("Test Exception"); 393GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 417var exception = new Exception("Test Exception"); 435GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 501var exception = new Exception("Test Exception"); 531GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 556var exception = new Exception("test exception"); 568GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "test exception", initialization: true); 624var exception = new Exception("test exception"); 640GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "test exception", initialization: true); 1855var exception = new Exception("Test Exception"); 1872GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception"); 1896var exception = new Exception("Test Exception"); 1913GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception"); 1937var exception = new Exception("Test Exception"); 1962GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\CompilationAPITests.cs (1)
1602Exception invalidCastSynTreeEx = Assert.Throws<InvalidCastException>(
DocumentationComments\CrefTests.cs (2)
1571Assert.ThrowsAny<Exception>(() => p.GetEffectiveBaseClass(null)); 1572Assert.ThrowsAny<Exception>(() => p.GetDeducedBaseType(null));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (7)
Syntax\SyntaxFactoryTests.cs (1)
128catch (Exception e)
Syntax\SyntaxRewriterTests.cs (6)
78Exception caught = null; 83catch (Exception e) 102Exception caught = null; 107catch (Exception e) 283Exception caught = null; 288catch (Exception e)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CSharpTestBase.cs (3)
1548internal CompilationVerifier CompileAndVerifyException<T>(string source, string expectedMessage = null, bool allowUnsafe = false, Verification verify = default) where T : Exception 1554internal CompilationVerifier CompileAndVerifyException<T>(CSharpCompilation comp, string expectedMessage = null, Verification verify = default) where T : Exception 1563var e = x.InnerException;
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Rename\CSharpRenameRewriterLanguageService.cs (3)
424catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 921catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 949catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
137catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.General))
Microsoft.CodeAnalysis.EditorFeatures (38)
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (1)
469catch (Exception e) when (FatalError.ReportAndCatch(e))
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (1)
265catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
191catch (Exception e) when (FatalError.ReportAndCatch(e))
CodeActions\CodeActionEditHandlerService.cs (2)
146catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken)) 172catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
EditAndContinue\ActiveStatementTrackingService.cs (3)
184catch (Exception e) when (FatalError.ReportAndCatch(e)) 251catch (Exception e) when (FatalError.ReportAndCatch(e)) 383catch (Exception e) when (FatalError.ReportAndCatch(e))
EditAndContinue\EditAndContinueLanguageService.cs (10)
88internal void Disable(Exception e) 135catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 181catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 204catch (Exception e) when (FatalError.ReportAndCatch(e)) 214catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 234catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 253catch (Exception e) when (FatalError.ReportAndCatch(e)) 264catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 303catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 354catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Editor\EditorLayerExtensionManager.cs (2)
48protected override void HandleNonCancellationException(object provider, Exception exception) 97private void ShowDetailedErrorInfo(Exception exception)
ErrorReporting\EditorErrorReportingService.cs (3)
24public void ShowDetailedErrorInfo(Exception exception) 27public void ShowGlobalErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception, params InfoBarUI[] items) 30public void ShowFeatureNotAvailableErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception)
FindReferences\FindReferencesCommandHandler.cs (1)
156catch (Exception e) when (FatalError.ReportAndCatch(e))
GoToDefinition\AbstractGoToCommandHandler`2.cs (1)
145catch (Exception ex) when (FatalError.ReportAndCatch(ex))
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
577catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
IntelliSense\NavigationActionFactory.cs (1)
88catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
IntelliSense\QuickInfo\QuickInfoSourceProvider.QuickInfoSource.cs (1)
96catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
Interactive\InteractiveSession.cs (1)
370catch (Exception e) when (FatalError.ReportAndPropagate(e))
LanguageServer\AlwaysActiveLanguageClientEventListener.cs (1)
70catch (Exception e) when (FatalError.ReportAndCatch(e))
NavigationBar\NavigationBarController.cs (1)
289catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Critical))
ReferenceHighlighting\ReferenceHighlightingViewTaggerProvider.cs (1)
196catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken, ErrorSeverity.General))
RenameTracking\RenameTrackingTaggerProvider.cs (1)
125catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.General))
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
322catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Shared\Extensions\ITextBufferEditExtensions.cs (2)
13private static Exception? s_lastException = null; 26catch (Exception e) when (ErrorReporting.FatalError.ReportAndCatch(e, ErrorReporting.ErrorSeverity.Critical))
Structure\AbstractStructureTaggerProvider.cs (1)
195catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Tagging\TaggerMainThreadManager.cs (1)
57catch (Exception ex)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
LanguageServer\TestOutputLspLogger.cs (1)
25public override void LogException(Exception exception, string? message = null, params object[] @params)
QuickInfo\ToolTipAssert.cs (1)
53catch (Exception)
TestExtensionErrorHandler.cs (2)
20public ImmutableList<Exception> Exceptions { get; private set; } = []; 28public void HandleError(object sender, Exception exception)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (2)
624public void LogException(object source, Exception exception) 627private static string ToLogFormat(Exception exception)
Utilities\AsynchronousOperationListenerTests.cs (1)
47foreach (var inner in e.InnerExceptions)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (13)
InlineHints\InlineHintsTagger.cs (1)
142catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.General))
InlineRename\CommandHandlers\RenameCommandHandler.cs (1)
109catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
InlineRename\UI\Dashboard\RenameDashboard.xaml.cs (1)
338catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
InlineRename\UI\SmartRename\SmartRenameViewModel.cs (1)
240catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Diagnostic))
Interactive\InteractiveEvaluator.cs (1)
256catch (Exception e) when (FatalError.ReportAndPropagate(e))
QuickInfo\LazyToolTip.cs (2)
68catch (Exception ex) when (FatalError.ReportAndCatch(ex)) 88catch (Exception ex) when (FatalError.ReportAndCatch(ex))
QuickInfo\OnTheFlyDocsView.xaml.cs (1)
247catch (Exception e) when (FatalError.ReportAndCatch(e))
SignatureHelp\Controller.Session_ComputeModel.cs (1)
141catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
StringCopyPaste\WpfStringCopyPasteService.cs (2)
58catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical)) 76catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
Suggestions\SuggestedActions\SuggestedAction.cs (1)
130catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
Utilities\RoslynServiceExtensions.cs (1)
155catch (Exception ex)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (20)
DkmExceptionUtilities.cs (1)
14internal static bool IsBadOrMissingMetadataException(Exception e)
DkmUtilities.cs (3)
78catch (Exception e) when (DkmExceptionUtilities.IsBadOrMissingMetadataException(e)) 117catch (Exception e) when (DkmExceptionUtilities.IsBadOrMissingMetadataException(e)) 153catch (Exception e) when (DkmExceptionUtilities.IsBadOrMissingMetadataException(e))
ExpressionCompiler.cs (4)
86catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 152catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 203catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 245catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e))
ExpressionEvaluatorFatalError.cs (2)
42catch (Exception ex) 61internal static bool CrashIfFailFastEnabled(Exception exception)
FrameDecoder.cs (5)
59catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 80catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 90Action<Exception> onFailure) 131catch (Exception e) 200catch (Exception e)
LanguageInstructionDecoder.cs (2)
60catch (Exception e) when (e is NotImplementedMetadataException or BadMetadataModuleException) 64catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e))
MetadataUtilities_Exceptions.cs (1)
16internal static bool IsBadOrMissingMetadataException(Exception e, string moduleName)
PDB\MethodDebugInfo.Native.cs (1)
650catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException)
PDB\MethodDebugInfo.Portable.cs (1)
213catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (8)
CSharp\MemberSignatureParser.cs (1)
324private static Exception InvalidSignature()
FunctionResolver.cs (1)
128catch (Exception e) when (DkmExceptionUtilities.IsBadOrMissingMetadataException(e))
MetadataDecoder.cs (1)
300private static Exception UnhandledMetadata()
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\DkmExceptionUtilities.cs (1)
14internal static bool IsBadOrMissingMetadataException(Exception e)
VisualBasic\MemberSignatureParser.cs (1)
364private static Exception InvalidSignature()
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (35)
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (2)
42catch (Exception ex) 61internal static bool CrashIfFailFastEnabled(Exception exception)
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.cs (13)
112catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 146void onException(Exception e) => completionRoutine(DkmGetChildrenAsyncResult.CreateErrorResult(e)); 188void onException(Exception e) => completionRoutine(DkmEvaluationEnumAsyncResult.CreateErrorResult(e)); 215catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 796void onException(Exception e) => completionRoutine(CreateEvaluationResultFromException(e, result, inspectionContext)); 827CompletionRoutine<Exception> onException) 835catch (Exception e) 908CompletionRoutine<Exception> onException) 917catch (Exception e) 1020private static DkmEvaluationResult CreateEvaluationResultFromException(Exception e, EvalResult result, DkmInspectionContext inspectionContext) 1054private readonly CompletionRoutine<Exception> _onException; 1058internal WorkList(DkmWorkList workList, CompletionRoutine<Exception> onException) 1092catch (Exception e)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (48)
Debugger\Engine\DkmClrValue.cs (3)
99catch (Exception e) 479var exception = e.InnerException; 506var exception = e.InnerException;
Debugger\Engine\DkmEvaluationAsyncResult.cs (2)
32internal Exception Exception { get; set; } 34public static DkmEvaluationAsyncResult CreateErrorResult(Exception exception)
Debugger\Engine\DkmEvaluationEnumAsyncResult.cs (2)
30internal Exception Exception { get; set; } 32public static DkmEvaluationEnumAsyncResult CreateErrorResult(Exception exception)
Debugger\Engine\DkmGetChildrenAsyncResult.cs (2)
32internal Exception Exception { get; set; } 34public static DkmGetChildrenAsyncResult CreateErrorResult(Exception exception)
Debugger\Engine\DkmMisc.cs (1)
19public static bool ReportCurrentNonFatalException(Exception currentException, string implementationName)
ResultProviderTestBase.cs (3)
188var exception = asyncResult.Exception; 257var exception = getChildrenResult.Exception; 272var exception = getItemsResult.Exception;
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\ExpressionEvaluatorFatalError.cs (2)
42catch (Exception ex) 61internal static bool CrashIfFailFastEnabled(Exception exception)
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.cs (13)
112catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 146void onException(Exception e) => completionRoutine(DkmGetChildrenAsyncResult.CreateErrorResult(e)); 188void onException(Exception e) => completionRoutine(DkmEvaluationEnumAsyncResult.CreateErrorResult(e)); 215catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e)) 796void onException(Exception e) => completionRoutine(CreateEvaluationResultFromException(e, result, inspectionContext)); 827CompletionRoutine<Exception> onException) 835catch (Exception e) 908CompletionRoutine<Exception> onException) 917catch (Exception e) 1020private static DkmEvaluationResult CreateEvaluationResultFromException(Exception e, EvalResult result, DkmInspectionContext inspectionContext) 1054private readonly CompletionRoutine<Exception> _onException; 1058internal WorkList(DkmWorkList workList, CompletionRoutine<Exception> onException) 1092catch (Exception e)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpSolutionAnalyzerConfigOptionsUpdater.cs (1)
68catch (Exception e) when (FatalError.ReportAndPropagate(e, ErrorSeverity.Diagnostic))
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Cohost\Handlers\Completion.cs (1)
106public void LogException(Exception exception, string? message = null, params object[] @params)
Microsoft.CodeAnalysis.Features (96)
CodeRefactorings\SyncNamespace\SyncNamespaceDocumentsNotInSolutionException.cs (1)
11internal sealed class SyncNamespaceDocumentsNotInSolutionException(ImmutableArray<DocumentId> documentIds) : Exception
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
77catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
55catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
332catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
60catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, ErrorSeverity.General))
Debugging\AbstractBreakpointResolver.cs (2)
116catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 152catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Debugging\DebugInformationReaderProvider.cs (1)
123/// <exception cref="Exception">Error reading debug information from <paramref name="stream"/>.</exception>
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
91catch (Exception ex) when (ex is BadImageFormatException or IOException)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
691catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 1273catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 3458catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
EditAndContinue\CommittedSolution.cs (3)
423catch (Exception e) 468catch (Exception e) 528catch (Exception e)
EditAndContinue\DebuggingSession.cs (6)
272catch (Exception e) when (e is FileNotFoundException or DirectoryNotFoundException) 276catch (Exception e) 394catch (Exception e) 490catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 794catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 871catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (3)
50catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 91catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 193catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (2)
38/// <exception cref="Exception">Error reading debug information from the PDB.</exception> 80catch (Exception e) when (FatalError.ReportAndCatch(e)) // likely a bug in the compiler/debugger
EditAndContinue\EditAndContinueService.cs (1)
177catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
EditAndContinue\EditSession.cs (5)
243catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 257catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 673catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 1149catch (Exception e) when (LogException(e) && FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 1154bool LogException(Exception e)
EditAndContinue\Remote\ActiveStatementSpanProviderCallback.cs (1)
26catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (2)
87catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 101private static ImmutableArray<DiagnosticData> GetInternalErrorDiagnosticData(Solution solution, Exception e)
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (5)
62catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 74catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 86catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 98catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 110catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
EditAndContinue\TraceLog.cs (5)
47catch (Exception e) 86catch (Exception e) 101catch (Exception e) 120catch (Exception e) 157private void AppendFileLoggingErrorInMemory(string? path, Exception e)
Emit\CompilationOutputFilesWithImplicitPdbPath.cs (2)
91catch (Exception e) when (e is FileNotFoundException or DirectoryNotFoundException) 95catch (Exception e) when (e is not IOException)
Emit\CompilationOutputs.cs (2)
44/// <exception cref="Exception">Error while reading assembly data.</exception> 93/// <exception cref="Exception">Error while reading assembly data.</exception>
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (1)
54catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (1)
145catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (2)
206catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 227catch (Exception e) when (FatalError.ReportAndPropagate(e))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (2)
61catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 153catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (4)
142catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 227catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 281catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 311catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
FindUsages\IRemoteFindUsagesService.cs (2)
127catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken)) 139catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
Formatting\AbstractNewDocumentFormattingService.cs (1)
57catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken, ErrorSeverity.General))
Intents\IntentDataProvider.cs (1)
35catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.General))
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
148catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken, ErrorSeverity.General)) 244catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Diagnostic))
MetadataAsSource\MetadataAsSourceFileService.cs (3)
140catch (Exception) 154catch (Exception) 225catch (Exception ex) when (FatalError.ReportAndCatch(ex))
NavigateTo\IRemoteNavigateToSearchService.cs (2)
61catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex)) 75catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex))
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
99catch (Exception ex) when (IOUtilities.IsNormalIOException(ex))
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (1)
100catch (Exception ex) when (IOUtilities.IsNormalIOException(ex))
SemanticSearch\IRemoteSemanticSearchService.cs (6)
68catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 79catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 90catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 101catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 112catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 123catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
SemanticSearch\SemanticSearchUtilities.cs (1)
49catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Diagnostic))
SolutionCrawler\AbstractDocumentDifferenceService.cs (1)
97catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
67catch (Exception ex)
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
18public static string CreateDiagnosticDescription(this Exception exception) 34private static string GetExceptionMessage(Exception exception)
Structure\Syntax\AbstractBlockStructureProvider.cs (1)
69catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
SymbolSearch\Windows\SymbolSearchUpdateEngine.cs (1)
59Func<Exception, CancellationToken, bool> reportAndSwallowExceptionUnlessCanceled)
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (9)
58private readonly Func<Exception, CancellationToken, bool> _reportAndSwallowExceptionUnlessCanceled; 86private static void LogException(Exception exception, string text) 196catch (Exception e) when (_service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken)) 278catch (Exception e) when (_service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken)) 407catch (Exception e) when (_service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken)) 444catch (Exception e) when (IOUtilities.IsNormalIOException(e)) 481catch (Exception e) when (_service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken)) 648catch (Exception e) when (_service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken)) 670catch (Exception e) when (IOUtilities.IsNormalIOException(e) || _service._reportAndSwallowExceptionUnlessCanceled(e, cancellationToken))
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
95catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex))
Wrapping\AbstractCodeActionComputer.cs (1)
310catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken, ErrorSeverity.Diagnostic))
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
490catch (Exception e)
FindUsages\DefinitionItemFactoryTests.cs (2)
92var failures = new List<Exception>(); 115catch (Exception e) when (e is IAssertionException)
Microsoft.CodeAnalysis.InteractiveHost (48)
Interactive\Core\InteractiveHost.cs (4)
104internal event Action<Exception?, int?>? InteractiveHostProcessCreationFailed; 262catch (Exception e) when (FatalError.ReportAndPropagate(e)) 293catch (Exception e) when (e is ObjectDisposedException || !remoteService.Process.IsAlive()) 349catch (Exception e) when (FatalError.ReportAndPropagate(e))
Interactive\Core\InteractiveHost.LazyRemoteService.cs (3)
128catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 162catch (Exception e) 215catch (Exception e)
Interactive\Core\InteractiveHost.RemoteService.cs (3)
102catch (Exception e) when (FatalError.ReportAndPropagate(e)) 173catch (Exception e) 288catch (Exception e)
Interactive\Core\InteractiveHost.Service.cs (7)
333catch (Exception e) 379catch (Exception e) 391private void DisplayException(Exception e) 473catch (Exception e) 480private static void ReportUnhandledException(Exception e) 608catch (Exception e) 714catch (Exception e)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (8)
204catch (Exception) 303catch (Exception e) 327catch (Exception e) when (e is not IOException) 344catch (Exception e) when (e is not IOException) 386catch (Exception e) 404catch (Exception e) 423catch (Exception e) 448catch (Exception e)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
774catch (Exception ex) when (
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
293catch (Exception ex) 447catch (Exception e) when (FatalError.ReportAndPropagate(e))
Microsoft.CodeAnalysis.LanguageServer (23)
BrokeredServices\ServiceBrokerFactory.cs (1)
77catch (Exception)
Contracts\ITelemetryReporter.cs (1)
13void ReportFault(string eventName, string description, int logLevel, bool forceDump, int processId, Exception exception);
CustomExportAssemblyLoader.cs (1)
47Exception loadException;
ExportProviderBuilder.cs (2)
92catch (Exception ex) 174catch (Exception ex)
HostWorkspace\ExtensionManager.cs (1)
19protected override void HandleNonCancellationException(object provider, Exception exception)
HostWorkspace\LanguageServerProjectSystem.cs (1)
308catch (Exception e)
HostWorkspace\ProjectInitializationHandler.cs (1)
106public void OnError(Exception error)
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (1)
84catch (Exception ex)
HostWorkspace\WorkspaceProject.cs (2)
227catch (Exception e) when (LanguageServerFatalError.ReportAndLogAndPropagate(e, _logger, "Error applying project system update.")) 254catch (Exception e) when (LanguageServerFatalError.ReportAndLogAndPropagate(e, _logger, "Error applying project system batch."))
HostWorkspace\WorkspaceProjectFactoryService.cs (1)
69catch (Exception e) when (LanguageServerFatalError.ReportAndLogAndPropagate(e, _logger, $"Failed to create project {creationInfo.DisplayName}"))
LanguageServerFatalError.cs (1)
19internal static bool ReportAndLogAndPropagate(Exception exception, ILogger logger, string logMessage, ErrorSeverity severity = ErrorSeverity.Uncategorized)
Logging\LspLogMessageLogger.cs (3)
31public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 70catch (Exception ex) when (ex is ObjectDisposedException or ConnectionLostException)
Logging\LspServiceLogger.cs (1)
28public override void LogException(Exception exception, string? message = null, params object[] @params) => _hostLogger.LogError(exception, message, @params);
Logging\RoslynLogger.cs (4)
58private static void ReportFault(Exception exception, ErrorSeverity severity, bool forceDump) 71foreach (var innerException in aggregateException.Flatten().InnerExceptions) 91catch (Exception e) 180private static string GetDescription(Exception exception)
Services\StarredCompletions\StarredCompletionsAssemblyHelper.cs (1)
114catch (Exception ex)
Testing\RunTestsHandler.cs (1)
191catch (Exception ex)
Microsoft.CodeAnalysis.LanguageServer.Protocol (37)
Extensions\ProtocolConversions.cs (1)
315catch (Exception e) when (FatalError.ReportAndPropagate(e))
ExternalAccess\VSMac\API\VSMacLspLoggerFactory.cs (1)
22void TraceException(Exception exception);
Features\CodeFixes\CodeFixService.cs (2)
415catch (Exception ex) 853catch (Exception e) when (e is not OperationCanceledException)
Features\Diagnostics\DiagnosticDataExtensions.cs (1)
44catch (Exception e) when (FatalError.ReportAndCatch(e))
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (5)
56internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e) 183Func<Exception, bool> GetAnalyzerExceptionFilter() 268catch (Exception e) when (!IsCanceled(e, cancellationToken)) 300catch (Exception e) when (!IsCanceled(e, cancellationToken)) 314private static bool IsCanceled(Exception ex, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (4)
49catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 116catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 157catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) 289catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
187catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (1)
250catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (1)
55catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Features\Options\SolutionAnalyzerConfigOptionsUpdater.cs (1)
102catch (Exception e) when (FatalError.ReportAndPropagate(e, ErrorSeverity.Diagnostic))
Handler\AbstractRefreshQueue.cs (1)
121catch (Exception ex) when (ex is ObjectDisposedException or ConnectionLostException)
Handler\Completion\CompletionResultFactory.cs (1)
552catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
Handler\InlineCompletions\XmlSnippetParser.cs (1)
54catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.General))
Handler\RequestContext.cs (1)
376public void TraceException(Exception exception)
Handler\ServerLifetime\LspServiceLifeCycleManager.cs (1)
34catch (Exception ex) when (ex is ObjectDisposedException or ConnectionLostException)
Handler\SourceGenerators\SourceGeneratorRefreshQueue.cs (1)
136catch (Exception ex) when (ex is ObjectDisposedException or ConnectionLostException)
LspServices\LspServices.cs (1)
241catch (Exception ex) when (FatalError.ReportAndCatch(ex))
LspServices\RequestTelemetryScope.cs (2)
31public override void RecordException(Exception exception) 51private static void ReportNonFatalError(Exception exception)
NoOpLspLogger.cs (1)
20public override void LogException(Exception exception, string? message = null, params object[] @params)
RoslynRequestExecutionQueue.cs (1)
34catch (Exception) when (!rethrowExceptions)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (1)
305catch (Exception)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLspLogger.cs (1)
20public abstract void LogException(Exception exception, string? message = null, params object[] @params);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractRequestScope.cs (1)
18public abstract void RecordException(Exception exception);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\ILspLogger.cs (1)
18void LogException(Exception exception, string? message = null, params object[] @params);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\QueueItem.cs (3)
124catch (Exception ex) 228catch (Exception ex) 256var exception = new Exception(message);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
283catch (Exception ex)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (11)
HandlerTests.cs (7)
136await Assert.ThrowsAnyAsync<Exception>(async () => await server.ExecuteRequestAsync<TestRequestTypeThree, string>(TestDocumentHandler.MethodName, request, CancellationToken.None)); 162await Assert.ThrowsAnyAsync<Exception>(async () 190await Assert.ThrowsAnyAsync<Exception>(async () 218await Assert.ThrowsAnyAsync<Exception>(async () 248await Assert.ThrowsAnyAsync<Exception>(async () 276await Assert.ThrowsAnyAsync<Exception>(async () 296await Assert.ThrowsAnyAsync<Exception>(async () => await testLspServer.ExecuteRequestAsync<TestRequestTypeOne, string>(TestDocumentHandler.MethodName, request, CancellationToken.None)).ConfigureAwait(false);
LspServicesTests.cs (2)
62await Assert.ThrowsAnyAsync<Exception>(async () => await CreateTestLspServerAsync("", mutatingLspWorkspace, initializationOptions: new() { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }, composition)); 69await Assert.ThrowsAnyAsync<Exception>(async () => await CreateTestLspServerAsync("", mutatingLspWorkspace, initializationOptions: new() { ServerKind = WellKnownLspServerKinds.CSharpVisualBasicLspServer }, composition));
UriTests.cs (2)
293await Assert.ThrowsAnyAsync<Exception>(async () 319await Assert.ThrowsAnyAsync<Exception>(async ()
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Utilities\TestOutputLogger.cs (2)
31public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.CodeAnalysis.Remote.ServiceHub (20)
Host\ProcessExtensions.cs (1)
27catch (Exception e) when (e is PlatformNotSupportedException or Win32Exception)
Host\RemoteWorkspace.cs (4)
105catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken, ErrorSeverity.Critical)) 133catch (Exception ex) when (FatalError.ReportAndPropagate(ex, ErrorSeverity.Critical)) 197catch (Exception ex) when (FatalError.ReportAndPropagate(ex, ErrorSeverity.Critical)) 266catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Host\RemoteWorkspace.InFlightSolution.cs (1)
127catch (Exception ex) when (FatalError.ReportAndPropagate(ex, ErrorSeverity.General))
Host\RemoteWorkspace.SolutionCreator.cs (1)
145catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Services\BrokeredServiceBase.cs (2)
119catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken)) 168catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
Services\BrokeredServiceBase.FactoryBase.cs (1)
78catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Services\EditAndContinue\RemoteEditAndContinueService.cs (3)
133catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken)) 154catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 169private static ImmutableArray<DiagnosticData> GetUnexpectedUpdateError(Solution solution, Exception e)
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (7)
109public static void ReportFault(Exception exception, FaultSeverity severity, bool forceDump) 122foreach (var innerException in aggregateException.Flatten().InnerExceptions) 186catch (Exception e) 192private static void UpdateBlamedMethod(IFaultUtility faultUtility, Exception exception) 225private static string GetDescription(Exception exception) 275catch (Exception) 297catch (Exception)
Microsoft.CodeAnalysis.Remote.Workspaces (41)
BrokeredServiceConnection.cs (17)
107catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 121catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 140catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 156catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 174catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 189catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 207catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 222catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 243catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 260catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 281catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 298catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 317catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 326private bool ReportUnexpectedException(Exception exception, CancellationToken cancellationToken) 351private static bool IsRemoteIOException(Exception exception) 354private void OnUnexpectedException(Exception exception, CancellationToken cancellationToken) 379Exception? internalException = null;
EditAndContinue\ManagedHotReloadLanguageService.cs (9)
97catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 116catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 150catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 181catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 201catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 226catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 265catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 298catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken)) 326catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
RemoteCallback.cs (8)
69catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 84catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 123catch (Exception exception) when (ReportUnexpectedException(exception, cancellationToken)) 132Exception? exception = null; 142catch (Exception ex) when ((exception = ex) == null) 182Exception? exception = null; 188catch (Exception ex) when ((exception = ex) == null) 209private static bool ReportUnexpectedException(Exception exception, CancellationToken cancellationToken)
Serialization\MessagePackFormatters.cs (4)
99catch (Exception e) when (e is not MessagePackSerializationException) 125catch (Exception e) when (e is not MessagePackSerializationException) 174catch (Exception e) when (e is not MessagePackSerializationException) 204catch (Exception e) when (e is not MessagePackSerializationException)
ServiceHubRemoteHostClient.cs (1)
85catch (Exception e)
SolutionAssetProvider.cs (2)
49Exception? exception = null; 56catch (Exception ex) when ((exception = ex) == null)
Microsoft.CodeAnalysis.Scripting (37)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (5)
80catch (Exception e) 96catch (Exception e) 229/// <exception cref="IOException">Error reading file <paramref name="fullPath"/>. See <see cref="Exception.InnerException"/> for details.</exception> 287/// <exception cref="IOException">Error reading file <paramref name="fullPath"/>. See <see cref="Exception.InnerException"/> for details.</exception> 620catch (Exception e) when (fileMayNotExist && (e is FileNotFoundException || e is DirectoryNotFoundException))
Hosting\CommandLine\CommandLineRunner.cs (2)
217catch (Exception e) 344private void DisplayException(Exception e)
Hosting\ObjectFormatter\CommonObjectFormatter.cs (1)
62public override string FormatException(Exception e)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (7)
421Exception exception; 515private void FormatException(Builder result, Exception exception) 555catch (Exception) 608catch (Exception e) 634catch (Exception e) 752catch (Exception e) 822Exception exception;
Hosting\ObjectFormatter\ObjectFormatter.cs (1)
20public abstract string FormatException(Exception e);
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
125catch (Exception) 239internal static object GetMemberValue(MemberInfo member, object obj, out Exception exception)
Script.cs (10)
195public Task<ScriptState> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 198internal abstract Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken); 223public Task<ScriptState> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 226internal abstract Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken); 381internal override Task<ScriptState> CommonRunAsync(object globals, Func<Exception, bool> catchException, CancellationToken cancellationToken) 384internal override Task<ScriptState> CommonRunFromAsync(ScriptState previousState, Func<Exception, bool> catchException, CancellationToken cancellationToken) 487public new Task<ScriptState<T>> RunAsync(object globals = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 547public new Task<ScriptState<T>> RunFromAsync(ScriptState previousState, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 579Func<Exception, bool> catchExceptionOpt, 582var exceptionOpt = (catchExceptionOpt != null) ? new StrongBox<Exception>() : null;
ScriptExecutionState.cs (3)
71StrongBox<Exception> exceptionHolderOpt, 72Func<Exception, bool> catchExceptionOpt, 124catch (Exception exception) when (catchExceptionOpt?.Invoke(exception) == true)
ScriptState.cs (5)
35public Exception Exception { get; } 42internal ScriptState(ScriptExecutionState executionState, Script script, Exception exceptionOpt) 156public Task<ScriptState<object>> ContinueWithAsync(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 180public Task<ScriptState<TResult>> ContinueWithAsync<TResult>(string code, ScriptOptions options = null, Func<Exception, bool> catchException = null, CancellationToken cancellationToken = default(CancellationToken)) 275internal ScriptState(ScriptExecutionState executionState, Script script, T value, Exception exceptionOpt)
src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (1)
151Exception e = Marshal.GetExceptionForHR(hr);
Microsoft.CodeAnalysis.Scripting.TestUtilities (3)
ObjectFormatterFixtures\MockDesktopTask.cs (2)
30public Exception Exception => null; 42public Exception Exception => m_task.Exception;
ScriptingTestHelpers.cs (1)
93catch (Exception e)
Microsoft.CodeAnalysis.Test.Utilities (24)
Assert\AssertEx.cs (2)
971List<(int, Exception)> exceptions = null; 980catch (Exception ex)
Compilation\Exceptions.cs (1)
39public ExecutionException(Exception innerException, string exePath)
CompilationVerifier.cs (2)
279catch (Exception) when (peVerify.Status.HasFlag(VerificationStatus.PassesOrFailFast)) 404catch (Exception e)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
895public Exception ThrownException { get; set; } 906catch (Exception e)
Diagnostics\DiagnosticExtensions.cs (9)
146Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null) 156Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 168Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 181Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 193Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 205Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 227Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 285Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 299Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException,
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (2)
292private readonly Exception _exception; 294public ThrowExceptionFromSupportedDiagnostics(Exception exception)
ExceptionHelper.cs (1)
40internal static string GetMessageFromException(Exception executionException, string exePath)
FX\EventWaiter.cs (2)
22private Exception _capturedException; 47catch (Exception ex)
Pe\BrokenStream.cs (1)
23public Exception ThrownException { get; private set; }
Platform\CoreClr\TestExecutionLoadContext.cs (1)
111catch (Exception ex)
TargetFrameworkUtil.cs (1)
436catch (Exception ex)
Microsoft.CodeAnalysis.UnitTests (9)
AnalyzerAssemblyLoaderTests.cs (3)
279Assert.ThrowsAny<Exception>(() => loader.LoadFromPath(path)); 1416var ex = Assert.ThrowsAny<Exception>(() => analyzer.GetType().GetMethod("Method")!.Invoke(analyzer, new object[] { sb }));
CommonCommandLineParserTests.cs (1)
72catch (Exception e)
Diagnostics\DiagnosticLocalizationTests.cs (3)
287var exceptions = new List<Exception>(); 288var handler = new EventHandler<Exception>((sender, ex) => exceptions.Add(ex)); 304Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException = (ex, a, diag, ct) => exceptionDiagnostics.Add(diag);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
99var exception = new Exception(); 158var exception = new Exception();
Microsoft.CodeAnalysis.VisualBasic (2)
Compilation\MethodCompiler.vb (2)
509Catch e As Exception When FatalError.ReportAndPropagateUnlessCanceled(e) 542Catch e As Exception When FatalError.ReportAndPropagateUnlessCanceled(e)
Microsoft.CodeAnalysis.Workspaces (150)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (1)
42catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
ErrorReporting\IErrorReportingService.cs (3)
24void ShowGlobalErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception, params InfoBarUI[] items); 26void ShowDetailedErrorInfo(Exception exception); 28void ShowFeatureNotAvailableErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception);
ExtensionManager\AbstractExtensionManager.cs (2)
15protected abstract void HandleNonCancellationException(object provider, Exception exception); 32public bool HandleException(object provider, Exception exception)
ExtensionManager\IExtensionManager.cs (1)
18bool HandleException(object provider, Exception exception);
ExtensionManager\IExtensionManagerExtensions.cs (4)
25catch (Exception e) when (extensionManager.HandleException(extension, e)) 41catch (Exception e) when (extensionManager.HandleException(extension, e)) 61catch (Exception e) when (extensionManager.HandleException(extension, e)) 82catch (Exception e) when (extensionManager.HandleException(extension, e))
ExtensionManager\ServicesLayerExtensionManager.cs (1)
17protected override void HandleNonCancellationException(object provider, Exception exception)
ExternalAccess\UnitTesting\Api\UnitTestingFatalErrorAccessor.cs (2)
14public static bool ReportWithoutCrash(this Exception e) 17public static bool ReportWithoutCrashUnlessCanceled(this Exception e)
FindSymbols\FindReferences\StreamingFindReferencesProgress.cs (1)
51catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (2)
84catch (Exception e) when (IOUtilities.IsNormalIOException(e)) 178catch (Exception e) when (IOUtilities.IsNormalIOException(e))
FindSymbols\StreamingProgressCollector.cs (1)
65catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
FindSymbols\SymbolFinder_Hierarchy.cs (1)
192catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken, ErrorSeverity.Diagnostic))
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
76catch (Exception e) when (e is BadImageFormatException or IOException) 88catch (Exception e) when (e is BadImageFormatException or IOException)
FindSymbols\SyntaxTree\SyntaxTreeIndex.ContextInfo.cs (1)
198catch (Exception)
FindSymbols\SyntaxTree\SyntaxTreeIndex.IdentifierInfo.cs (1)
55catch (Exception)
FindSymbols\SyntaxTree\SyntaxTreeIndex.LiteralInfo.cs (1)
39catch (Exception)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.DeclarationInfo.cs (1)
28catch (Exception)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.ExtensionMethodInfo.cs (1)
69catch (Exception)
Log\IErrorLogger.cs (1)
14void LogException(object source, Exception exception);
Log\WorkspaceErrorLogger.cs (2)
23public void LogException(object source, Exception exception) 26private static string ToLogFormat(Exception exception)
Remote\RemoteArguments.cs (1)
118catch (Exception ex) when (FatalError.ReportAndCatch(ex))
Rename\ConflictEngine\ConflictResolver.cs (1)
314catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Rename\ConflictEngine\ConflictResolver.Session.cs (7)
254catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 463catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 646catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 688catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 723catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 767catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.Critical)) 851catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e))
Serialization\SerializerService_Reference.cs (1)
241catch (Exception ex) when (ex is BadImageFormatException or
Shared\Extensions\ISymbolExtensions.cs (1)
253catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Shared\Utilities\AsyncBatchingWorkQueue`2.cs (1)
273catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, ErrorSeverity.Critical))
Shared\Utilities\DocumentationComment.cs (1)
135catch (Exception)
Shared\Utilities\IOUtilities.cs (3)
31catch (Exception e) when (IsNormalIOException(e)) 44catch (Exception e) when (IsNormalIOException(e)) 51public static bool IsNormalIOException(Exception e)
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (2)
177catch (Exception ex) 419catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Diagnostic))
src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerAssemblyLoader.cs (1)
191catch (Exception ex)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (8)
204catch (Exception) 303catch (Exception e) 327catch (Exception e) when (e is not IOException) 344catch (Exception e) when (e is not IOException) 386catch (Exception e) 404catch (Exception e) 423catch (Exception e) 448catch (Exception e)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
774catch (Exception ex) when (
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
293catch (Exception ex)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (7)
43catch (Exception e) 56catch (Exception e) 76catch (Exception e) 333catch (Exception e) 354catch (Exception e) 683catch (Exception e) 936catch (Exception e)
src\Dependencies\Collections\Internal\ThrowHelper.cs (1)
177internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
28/// <exception cref="Exception">
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (1)
79=> compilation.GetTypeByMetadataName(typeof(Exception).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (2)
293catch (Exception ex) 447catch (Exception e) when (FatalError.ReportAndPropagate(e))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EventMap.cs (1)
174catch (Exception e) when (FatalError.ReportAndPropagate(e))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (2)
313Exception? exception = null; 324catch (Exception ex) when ((exception = ex) == null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (9)
169catch (Exception e) 184catch (Exception e) 205catch (Exception e) 334catch (Exception e) 349catch (Exception e) 370catch (Exception e) 411private List<Exception> _exceptions; 504public void RecordException(Exception e) 509(_exceptions ??= new List<Exception>()).Add(e);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SoftCrashException.cs (2)
37public SoftCrashException(string message, Exception innerException) : base(message, innerException) { } 39public SoftCrashException(string message, Exception innerException, CancellationToken token) : base(message, innerException, token) { }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (1)
82private static Exception CreateDocumentNotFoundException()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (1)
51catch (Exception)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
68List<Exception>? exceptions = null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefUtilities.cs (3)
14public static void DisposeWithExceptionTracking<T>(T instance, [NotNullIfNotNull("exceptions")] ref List<Exception>? exceptions) 21catch (Exception ex) when (FatalError.ReportAndCatch(ex)) 23exceptions ??= new List<Exception>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
85List<Exception>? exceptions = null;
Storage\AbstractPersistentStorageService.cs (2)
94catch (Exception e) when (Recover(e)) 99bool Recover(Exception ex)
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
272catch (Exception)
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (1)
195catch (Exception ex)
Storage\SQLite\v2\SQLitePersistentStorage_StringIds.cs (3)
99catch (Exception ex) 155catch (Exception ex) 189catch (Exception ex)
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
49catch (Exception e) when (e is DllNotFoundException or EntryPointNotFoundException)
Storage\StorageDatabaseLogger.cs (4)
19private Exception? _reportedException; 23private readonly ConcurrentDictionary<Type, Exception> _set = new(concurrencyLevel: 2, capacity: 10); 25internal static void LogException(Exception ex) 28private void LogExceptionWorker(Exception ex)
Utilities\Documentation\XmlDocumentationProvider.cs (1)
84catch (Exception)
Workspace\CommandLineProject.cs (1)
94catch (Exception e)
Workspace\Host\PersistentStorage\IPersistentStorageFaultInjectionService.cs (1)
14void OnFatalError(Exception ex);
Workspace\ProjectSystem\IRuleSetFile.cs (1)
16Exception GetException();
Workspace\Solution\Document.cs (2)
375catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 491catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Workspace\Solution\DocumentState.cs (2)
208catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 230catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
Workspace\Solution\ProjectState_Checksum.cs (1)
79catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
Workspace\Solution\Solution.cs (1)
655catch (Exception ex) when (FatalError.ReportAndPropagate(ex))
Workspace\Solution\SolutionCompilationState.cs (3)
1238catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 1258catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 1611catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (6)
267catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 350catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 395catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 465catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical)) 980catch (Exception e) when (FatalError.ReportWithDumpAndCatch(e, ErrorSeverity.Critical)) 1001public CompilationTrackerValidationException(string message, Exception inner) : base(message, inner) { }
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
92catch (Exception ex) when (FatalError.ReportAndCatch(ex)) 103catch (Exception ex) when (FatalError.ReportAndCatch(ex))
Workspace\Solution\SolutionCompilationState_Checksum.cs (1)
155catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Workspace\Solution\SolutionState_Checksum.cs (1)
160catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Workspace\Solution\TextDocumentState_Checksum.cs (1)
46catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
Workspace\Workspace.cs (2)
550catch (Exception e) when (FatalError.ReportAndPropagate(e, ErrorSeverity.Critical)) 734catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
Workspace\Workspace_Editor.cs (1)
706catch (Exception e) when (FatalError.ReportAndPropagate(e, ErrorSeverity.General))
Microsoft.CodeAnalysis.Workspaces.MSBuild (10)
MSBuild\BuildHostProcessManager.cs (2)
310catch (Exception e) when (e is IOException or XmlException) 441catch (Exception e)
MSBuild\DiagnosticReporter.cs (1)
23public void Report(DiagnosticReportingMode mode, string message, Func<string, Exception>? createException = null)
MSBuild\DiagnosticReporterLoggerProvider.cs (2)
48public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
MSBuild\PathResolver.cs (2)
27catch (Exception) 52catch (Exception)
Rpc\RpcClient.cs (3)
49Exception? processingException = null; 90catch (Exception ex) 98catch (Exception ex)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (46)
Build\ProjectBuildManager.cs (3)
122catch (Exception e) 321catch (Exception e) 327catch (Exception e)
MSBuild\Logging\DiagnosticLog.cs (1)
31public void Add(Exception exception, string projectFilePath, DiagnosticLogItemKind kind = DiagnosticLogItemKind.Error)
Rpc\RpcServer.cs (2)
73catch (Exception e) 160catch (Exception e)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (8)
204catch (Exception) 303catch (Exception e) 327catch (Exception e) when (e is not IOException) 344catch (Exception e) when (e is not IOException) 386catch (Exception e) 404catch (Exception e) 423catch (Exception e) 448catch (Exception e)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (1)
774catch (Exception ex) when (
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (3)
24internal static void OnFatalException(Exception exception) 61internal static void DumpStackTrace(Exception? exception = null, string? message = null) 72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\FatalError.cs (14)
21public OperationCanceledIgnoringCallerTokenException(Exception innerException) 29public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); 35private static Exception? s_reportedException; 43/// cref="ReportNonFatalError(Exception, ErrorSeverity, bool)"/></param> 99public static bool ReportAndPropagate(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 111public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 140public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 161public static bool ReportAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 173public static bool ReportWithDumpAndCatch(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 186public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized) 216public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) 237private static void Report(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 248public static void ReportNonFatalError(Exception exception, ErrorSeverity severity = ErrorSeverity.Uncategorized, bool forceDump = false) 253private static void ReportException(Exception exception, ErrorSeverity severity, bool forceDump, ErrorReporterHandler? handler)
src\Compilers\Core\Portable\InternalUtilities\RoslynParallel.cs (1)
32catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken))
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
293catch (Exception ex)
src\Compilers\Core\Portable\InternalUtilities\XmlUtilities.cs (1)
85catch (Exception e) when (e.GetType().FullName == "System.Xml.XPath.XPathException")
src\Dependencies\Collections\Internal\ArraySortHelper.cs (7)
43catch (Exception e) 56catch (Exception e) 76catch (Exception e) 333catch (Exception e) 354catch (Exception e) 683catch (Exception e) 936catch (Exception e)
src\Dependencies\Collections\Internal\ThrowHelper.cs (1)
177internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (2)
73catch (Exception e) 160catch (Exception e)
VisualStudioMSBuildWorkspaceTests.cs (2)
3288var exception = await Assert.ThrowsAsync<Exception>(() => workspace.OpenSolutionAsync(solutionFilePath));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
ITestErrorHandler.cs (1)
16ImmutableList<Exception> Exceptions { get; }
TestErrorReportingService.cs (3)
28public void ShowDetailedErrorInfo(Exception exception) 31public void ShowGlobalErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception, params InfoBarUI[] items) 34public void ShowFeatureNotAvailableErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
Remote\ServiceDescriptorTests.cs (1)
310catch (Exception e)
UtilityTest\CancellationSeriesTests.cs (1)
121var exception = new Exception();
UtilityTest\ExceptionHelpersTests.cs (2)
44catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) 65var e = new Exception("Hello");
Microsoft.CommonLanguageServerProtocol.Framework.Package (8)
AbstractLanguageServer.cs (1)
305catch (Exception)
AbstractLspLogger.cs (1)
20public abstract void LogException(Exception exception, string? message = null, params object[] @params);
AbstractRequestScope.cs (1)
18public abstract void RecordException(Exception exception);
ILspLogger.cs (1)
18void LogException(Exception exception, string? message = null, params object[] @params);
QueueItem.cs (3)
124catch (Exception ex) 228catch (Exception ex) 256var exception = new Exception(message);
RequestExecutionQueue.cs (1)
283catch (Exception ex)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (1)
Mocks\NoOpLspLogger.cs (1)
21public override void LogException(Exception exception, string? message = null, params object[] @params)
Microsoft.CSharp (13)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
46System.Linq.Expressions.Expression.Constant(new DynamicBindingFailedException(), typeof(Exception)), typeof(object)), System.Dynamic.BindingRestrictions.Combine(v));
Microsoft\CSharp\RuntimeBinder\Error.cs (9)
10internal static Exception InternalCompilerError() 15internal static Exception BindPropertyFailedMethodGroup(object p0) 20internal static Exception BindPropertyFailedEvent(object p0) 25internal static Exception BindInvokeFailedNonDelegate() 30internal static Exception BindStaticRequiresType(string paramName) => 33internal static Exception NullReferenceOnMemberException() 38internal static Exception BindCallToConditionalMethod(object p0) 43internal static Exception BindToVoidMethodButExpectResult() 48internal static Exception DynamicArgumentNeedsValue(string paramName) =>
Microsoft\CSharp\RuntimeBinder\RuntimeBinderException.cs (1)
40public RuntimeBinderException(string? message, Exception? innerException)
Microsoft\CSharp\RuntimeBinder\RuntimeBinderInternalCompilerException.cs (1)
40public RuntimeBinderInternalCompilerException(string? message, Exception? innerException)
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (1)
594public Exception ReportErrors()
Microsoft.Data.Analysis (3)
PrimitiveDataFrameColumn.cs (3)
762catch (Exception) 770catch (Exception) 778catch (Exception)
Microsoft.Data.Analysis.Tests (4)
TextFieldParserTests.cs (4)
193Assert.Throws<Exception>(() => parser.ReadFields()); 318Assert.Throws<Exception>(() => parser.ReadFields()); 367Assert.Throws<Exception>(() => parser.ReadFields()); 383Assert.Throws<Exception>(() => parser.ReadFields());
Microsoft.DotNet.Arcade.Sdk (4)
src\CheckRequiredDotNetVersion.cs (2)
50catch (Exception e) 75catch (Exception e)
src\DownloadFile.cs (1)
179catch (Exception e) when (e is HttpRequestException ||
src\GenerateChecksums.cs (1)
52catch (Exception e)
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
292catch (Exception)
Microsoft.DotNet.Build.Tasks.Feed (15)
src\BlobFeedAction.cs (1)
136catch (Exception exc)
src\BuildModelFactory.cs (1)
230catch (Exception e)
src\common\AzureStorageUtils.cs (2)
113Exception mostRecentlyCaughtException = null; 293catch (Exception e) when (e is HttpRequestException || e is TaskCanceledException)
src\common\CreateAzureContainer.cs (1)
52catch (Exception e)
src\common\GeneralUtils.cs (1)
169catch (Exception e)
src\common\UploadToAzure.cs (1)
130catch (Exception e)
src\CreateAzureDevOpsFeed.cs (1)
184catch (Exception e)
src\GenerateBuildManifest.cs (1)
152catch (Exception e)
src\model\SetupTargetFeedConfigV3.cs (2)
193/// <exception cref="Exception">Throws if the feed cannot be created</exception> 221/// <exception cref="Exception">Throws if the feed cannot be created</exception>
src\PublishSignedAssets.cs (1)
71catch (Exception e)
src\PushToBuildStorage.cs (3)
261catch (Exception e) 362catch (Exception ex) when (IsIoRelatedException(ex)) 399static bool IsIoRelatedException(Exception e)
Microsoft.DotNet.Build.Tasks.Feed.Tests (6)
PublishToSymbolServerTest.cs (6)
298var actualError = await Assert.ThrowsAsync<Exception>(() => 341var actualError = await Assert.ThrowsAsync<Exception>(() => 449var actualError = await Assert.ThrowsAsync<Exception>(() =>
Microsoft.DotNet.Build.Tasks.Installers (5)
src\BuildFPMToolPreReqs.cs (3)
54catch (Exception e) 84catch (Exception e) 107catch (Exception e)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
src\GenerateMacOSDistributionFile.cs (1)
123catch (Exception ex)
Microsoft.DotNet.Build.Tasks.Packaging (13)
GenerateNuSpec.cs (1)
100catch (Exception ex)
GeneratePackageReport.cs (2)
210catch (Exception ex) 310catch (Exception ex)
GetApplicableAssetsFromPackages.cs (1)
167catch (Exception ex)
GetPackageDescription.cs (1)
103catch (Exception excep)
HarvestPackage.cs (1)
186catch (Exception ex)
NuGetPack.cs (1)
309catch (Exception e)
NuGetUtility.cs (1)
43catch (Exception e)
PackageReport.cs (1)
85catch(Exception exception)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
ValidatePackage.cs (3)
465catch (Exception ex) 511catch (Exception ex) 529catch (Exception ex)
Microsoft.DotNet.Build.Tasks.TargetFramework (1)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
Microsoft.DotNet.Build.Tasks.VisualStudio (4)
OptProf\FindLatestDrop.cs (1)
43catch (Exception e)
OptProf\GenerateTrainingInputFiles.cs (1)
52catch (Exception e)
OptProf\GetRunSettingsSessionConfiguration.cs (2)
89catch (Exception e) 116catch (Exception e)
Microsoft.DotNet.Build.Tasks.Workloads (8)
Msi\MsiBase.wix.cs (2)
192/// <exception cref="Exception"></exception> 207/// <exception cref="Exception"></exception>
Msi\WorkloadManifestMsi.wix.cs (1)
46/// <exception cref="Exception" />
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
Swix\SwixProjectBase.cs (1)
101/// <exception cref="Exception" />
VisualStudioWorkloadTaskBase.wix.cs (1)
107catch (Exception e)
WorkloadManifestPackage.wix.cs (1)
75/// <exception cref="Exception" />
WorkloadPackageBase.cs (1)
319/// <exception cref="Exception"></exception>
Microsoft.DotNet.Build.Tasks.Workloads.Tests (2)
SwixPackageTests.cs (2)
28Exception e = Assert.Throws<Exception>(() =>
Microsoft.DotNet.Deployment.Tasks.Links (5)
Microsoft.DotNet.GenAPI (1)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
Microsoft.DotNet.GenFacades (4)
ClearAssemblyReferenceVersions.cs (1)
63catch (Exception e)
GenPartialFacadeSource.cs (1)
55catch (Exception e)
NotSupportedAssemblyGenerator.cs (1)
81catch(Exception ex)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
Microsoft.DotNet.Helix.Client (2)
HelixApi.cs (2)
16public override bool IsRetriableException(Exception exception) 40catch (Exception)
Microsoft.DotNet.Helix.Sdk (17)
AzureDevOpsTask.cs (7)
76catch (Exception ex) 160catch (Exception) 182public static bool IsRetryableHttpException(Exception ex) 192public Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry, 198public async Task<T> RetryAsync<T>(Func<Task<T>> function, Action<Exception> logRetry, 199Func<Exception, bool> isRetryable, CancellationToken cancellationToken) 215catch (Exception ex) when (isRetryable(ex))
CancelHelixJob.cs (1)
70catch (Exception toLog)
FindDotNetCliPackage.cs (4)
119catch (Exception ex) 161catch (Exception ex) 246catch (Exception toLog) 270catch (Exception toLog)
GetHelixWorkItems.cs (1)
111catch (Exception ex)
HelixTask.cs (2)
87catch (Exception ex) 97protected void LogExceptionRetry(Exception ex)
LoggerExtensions.cs (1)
53Exception exception,
ProvisioningProfileProvider.cs (1)
203catch (Exception e)
Microsoft.DotNet.Internal.SymbolHelper (6)
SymbolPromotionHelper.cs (3)
159catch (Exception ex) 221catch (Exception ex) 276catch (Exception ex)
SymbolUploadHelper.cs (3)
319catch (Exception ex) 389catch (Exception ex) 493catch (Exception ex)
Microsoft.DotNet.MacOsPkg (3)
Program.cs (3)
97catch (Exception e) 135catch (Exception e) 166catch (Exception e)
Microsoft.DotNet.NuGetRepack.Tasks (8)
src\NuGetVersionUpdater.cs (4)
285var errors = new List<Exception>(); 352var errors = new List<Exception>(); 366catch (Exception e) 375private static void ThrowExceptions(IReadOnlyCollection<Exception> exceptions)
src\ReplacePackageParts.cs (2)
196catch (Exception e) 265catch (Exception)
src\UpdatePackageVersionTask.cs (2)
96foreach (var inner in e.InnerExceptions) 101catch (Exception e)
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
367public static T Throws<T>(Action del, bool allowDerived = false) where T : Exception 373catch (Exception ex)
Microsoft.DotNet.PackageTesting (2)
GetCompatiblePackageTargetFrameworks.cs (1)
51catch (Exception e)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
Microsoft.DotNet.RemoteExecutor (2)
Program.cs (1)
75catch (Exception exc) when (exc is not (TargetInvocationException { InnerException: AccessViolationException } or AccessViolationException))
RemoteInvokeHandle.cs (1)
161catch (Exception exc)
Microsoft.DotNet.SharedFramework.Sdk (2)
src\Common\Internal\BuildTask.cs (1)
53public void LogErrorFromException(Exception exception, bool showStackTrace)
src\GenerateSharedFrameworkDepsFile.cs (1)
122catch (Exception ex)
Microsoft.DotNet.SignCheck (3)
SignCheck.cs (2)
446catch (Exception e) 481catch (Exception e)
src\Common\Internal\AssemblyResolution.cs (1)
40catch (Exception e)
Microsoft.DotNet.SignCheckLibrary (3)
Verification\JarVerifier.cs (1)
55catch (Exception e)
Verification\MsiVerifier.cs (2)
60catch (Exception e) 86catch (Exception e)
Microsoft.DotNet.SignTool (12)
src\BatchSignUtil.cs (1)
455catch (Exception e)
src\Configuration.cs (1)
796catch (Exception e)
src\SignToolTask.cs (1)
564catch (Exception)
src\StrongName.cs (4)
91catch (Exception e) 261catch (Exception e) 305/// <exception cref="Exception"></exception> 798catch (Exception)
src\VerifySignatures.cs (3)
60catch(Exception e) 116catch (Exception e) 225catch (Exception)
src\ZipData.cs (2)
536catch(Exception e) 563/// <exception cref="Exception"></exception>
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
42catch (Exception ex)
Microsoft.DotNet.Tar (1)
Program.cs (1)
45catch (Exception e)
Microsoft.DotNet.VersionTools (4)
Automation\GitHubVersionsRepoUpdater.cs (1)
150catch (Exception ex) when (ex is HttpRequestException || ex is NotFastForwardUpdateException)
Automation\NupkgInfoFactory.cs (1)
50catch (Exception ex)
BuildInfo.cs (1)
114catch (Exception e)
Dependencies\BuildOutput\ProjectJsonUpdater.cs (1)
55catch (Exception e)
Microsoft.DotNet.VersionTools.Cli (2)
VersionTrimmingOperation.cs (2)
58catch (Exception e) 73catch (Exception e)
Microsoft.DotNet.XUnitAssert.Tests (539)
AsyncCollectionAssertsTests.cs (38)
39 var ex = Record.Exception(() => Assert.All(items, item => Assert.Equal(1, item))); 91 var ex = Record.Exception(() => Assert.All(items, x => Assert.Equal(1, x))); 137 var ex = Record.Exception( 170 var ex = Record.Exception(() => 208 var ex = await Record.ExceptionAsync( 249 var ex = await Record.ExceptionAsync(() => 307 var ex = Record.Exception(() => Assert.Contains(42, list)); 376 var ex = Record.Exception(() => Assert.Contains(list, item => item.StartsWith("q"))); 409 var ex = Record.Exception(() => Assert.Distinct(list)); 425 var ex = Record.Exception(() => Assert.Distinct(list)); 450 var ex = Record.Exception(() => Assert.Distinct(list, StringComparer.OrdinalIgnoreCase)); 483 var ex = Record.Exception(() => Assert.DoesNotContain(42, list)); 553 var ex = Record.Exception(() => Assert.DoesNotContain(list, item => item.StartsWith("w"))); 594 var ex = Record.Exception(() => Assert.Empty(list)); 639 var ex = Record.Exception(action); 661 var ex = Record.Exception(action); 767 var ex = Record.Exception(action); 791 var ex = Record.Exception(action); 872 var ex = Record.Exception(action); 924 var ex = Record.Exception(action); 964 var ex = Record.Exception(action); 1025 var ex = Record.Exception(action); 1053 var ex = Record.Exception(() => Assert.NotEmpty(list)); 1093 var ex = Record.Exception(action); 1140 var ex = Record.Exception(action); 1190 var ex = Record.Exception(action); 1231 var ex = Record.Exception(action); 1273 var ex = Record.Exception(action); 1331 var ex = Record.Exception(action); 1358 var ex = Record.Exception(action); 1392 var ex = Record.Exception(() => Assert.Single(collection)); 1413 var ex = Record.Exception(() => Assert.Single(collection)); 1428 var ex = Record.Exception(() => Assert.Single(collection)); 1453 var ex = Record.Exception(() => Assert.Single(collection)); 1488 var ex = Record.Exception(() => Assert.Single(collection, item => false)); 1504 var ex = Record.Exception(() => Assert.Single(collection, item => true)); 1521 var ex = Record.Exception(() => Assert.Single(collection, item => item == 4)); 1548 var ex = Record.Exception(() => Assert.Single(collection, c => c == 'Q'));
BooleanAssertsTests.cs (6)
18 var ex = Record.Exception(() => Assert.False(true)); 32 var ex = Record.Exception(() => Assert.False(null)); 47 var ex = Record.Exception(() => Assert.False(true, "Custom User Message")); 66 var ex = Record.Exception(() => Assert.True(false)); 80 var ex = Record.Exception(() => Assert.True(null)); 95 var ex = Record.Exception(() => Assert.True(false, "Custom User Message"));
CollectionAssertsTests.cs (69)
37 var ex = Record.Exception(() => Assert.All(items, item => Assert.Equal(1, item))); 89 var ex = Record.Exception(() => Assert.All(items, x => Assert.Equal(1, x))); 135 var ex = Record.Exception( 169 var ex = Record.Exception(() => 208 var ex = await Record.ExceptionAsync( 249 var ex = await Record.ExceptionAsync(() => 307 var ex = Record.Exception(() => Assert.Contains(42, list)); 369 var ex = Record.Exception(() => Assert.Contains("HI THERE", set, StringComparer.Ordinal)); 410 var ex = Record.Exception(() => Assert.Contains(list, item => item.StartsWith("q"))); 443 var ex = Record.Exception(() => Assert.Distinct(list)); 459 var ex = Record.Exception(() => Assert.Distinct(list)); 484 var ex = Record.Exception(() => Assert.Distinct(list, StringComparer.OrdinalIgnoreCase)); 517 var ex = Record.Exception(() => Assert.DoesNotContain(42, list)); 550 var ex = Record.Exception(() => Assert.DoesNotContain("HI THERE", set)); 568 var ex = Record.Exception(() => Assert.DoesNotContain("HI THERE", set)); 631 var ex = Record.Exception(() => Assert.DoesNotContain(list, item => item.StartsWith("w"))); 672 var ex = Record.Exception(() => Assert.Empty(list)); 712 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 729 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 801 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 869 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 878 var ex = Record.Exception(() => Assert.Equal(new object[] { 1, 2, 3 }, new object[] { 1, 2, 3L })); 1023 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1038 var ex = Record.Exception(() => Assert.Equal(expected, actual, new IntComparer(false))); 1107 var ex = Record.Exception(() => Assert.Equal(new[] { 1, 2 }, new[] { 1, 3 }, new ThrowingComparer())); 1152 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1182 var ex = Record.Exception(() => Assert.Equal(expected, actual, (x, y) => false)); 1228 var ex = Record.Exception(() => 1275 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1292 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1325 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1369 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1399 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1481 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1537 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1555 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1572 var ex = Record.Exception(() => Assert.Equal(expected, actual, new BitArrayComparer())); 1616 var ex = Record.Exception(() => Assert.NotEmpty(list)); 1654 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1691 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1707 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1741 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1779 var ex = Record.Exception(() => Assert.NotEqual(expected, actual, new IntComparer(true))); 1807 var ex = Record.Exception(() => Assert.NotEqual(new[] { 1, 2 }, new[] { 1, 2 }, new ThrowingComparer())); 1843 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1889 var ex = Record.Exception(() => Assert.NotEqual(expected, actual, (x, y) => true)); 1903 var ex = Record.Exception(() => 1932 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 1949 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2018 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2057 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2115 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2168 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2190 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2211 var ex = Record.Exception(() => Assert.NotEqual(expected, actual, new BitArrayComparer())); 2289 var ex = Record.Exception(() => Assert.Single(collection)); 2310 var ex = Record.Exception(() => Assert.Single(collection)); 2325 var ex = Record.Exception(() => Assert.Single(collection)); 2365 var ex = Record.Exception(() => Assert.Single(collection, "foo")); 2381 var ex = Record.Exception(() => Assert.Single(collection, "Hello")); 2398 var ex = Record.Exception(() => Assert.Single(collection, 4)); 2424 var ex = Record.Exception(() => Assert.Single(collection)); 2445 var ex = Record.Exception(() => Assert.Single(collection)); 2460 var ex = Record.Exception(() => Assert.Single(collection)); 2485 var ex = Record.Exception(() => Assert.Single(collection)); 2520 var ex = Record.Exception(() => Assert.Single(collection, item => false)); 2536 var ex = Record.Exception(() => Assert.Single(collection, item => true)); 2553 var ex = Record.Exception(() => Assert.Single(collection, item => item == 4)); 2580 var ex = Record.Exception(() => Assert.Single(collection, c => c == 'Q'));
DictionaryAssertsTests.cs (2)
43 var ex = Record.Exception(action); 95 var ex = Record.Exception(action);
EqualityAssertsTests.cs (153)
26 var ex = Record.Exception(() => Assert.Equal(42, 2112)); 40 var ex = Record.Exception( 78 var ex = Record.Exception(() => Assert.Equal(42, 42, new Comparer<int>(false))); 106 var ex = Record.Exception(() => Assert.Equal(42, 2112, new ThrowingIntComparer())); 129 var ex = Record.Exception(() => Assert.Equal(new[] { 1, 2 }, new[] { 1, 3 }, new ThrowingEnumerableComparer())); 167 var ex = Record.Exception(() => Assert.Equal(42, 42, (x, y) => false)); 181 var ex = Record.Exception(() => Assert.Equal(42, 2112, (e, a) => throw new DivideByZeroException())); 196 var ex = Record.Exception( 233 var ex = Record.Exception(() => Assert.Equal(obj1, obj2)); 263 var ex = Record.Exception(action); 297 var ex = Record.Exception(action); 328 var ex = Record.Exception(() => Assert.Equal(obj1, obj2)); 354 var ex = Record.Exception(() => Assert.Equal<ComparableBaseClass>(expected, actual)); 380 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 406 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 436 var ex = Record.Exception(action); 471 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 501 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 527 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 556 var ex = Record.Exception(() => Assert.Equal(nco1, nco2)); 588 var ex = Record.Exception(() => Assert.Equal(obj1, obj2)); 614 var ex = Record.Exception(() => Assert.Equal<EquatableBaseClass>(expected, actual)); 640 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 666 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 696 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 726 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 763 var ex = Record.Exception(action); 798 var ex = Record.Exception(action); 822 var ex = Record.Exception(action); 859 var ex = Record.Exception(action); 891 var ex = Record.Exception(() => Assert.Equal(x, y)); 922 var ex = Record.Exception(action); 954 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 986 var ex = Record.Exception(() => Assert.Equal(expected, (object)actual)); 1005 var ex = Record.Exception(action); 1028 var ex = Record.Exception(() => Assert.Equal(expected, actual, new MyComparer())); 1042 var ex = Record.Exception(() => Assert.Equal(new UnsafeEnumerable(), new[] { 1, 2, 3 }, new MyComparer())); 1086 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1140 var ex = Record.Exception(action); 1174 var ex = Record.Exception(action); 1204 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1233 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1259 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1276 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1293 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1323 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1345 var ex = Record.Exception(() => Assert.Equal(expected, actual, (string l, string r) => true)); 1379 var ex = Record.Exception(action); 1418 var ex = Record.Exception(action); 1444 var ex = Record.Exception(action); 1483 var ex = Record.Exception(action); 1522 var ex = Record.Exception(action); 1551 var ex = Record.Exception(() => Assert.Equal(expected, actual, (string l, string r) => true)); 1581 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1609 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1639 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1669 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1706 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1743 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1781 var ex = Record.Exception(() => Assert.Equal(date1, date2, precision)); 1792 var ex2 = Record.Exception(() => Assert.Equal(date2, date1, precision)); 1829 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1862 var ex = Record.Exception(() => Assert.Equal(expected, actual)); 1900 var ex = Record.Exception(() => Assert.Equal(date1, date2, precision)); 1911 var ex2 = Record.Exception(() => Assert.Equal(date2, date1, precision)); 1949 var ex = Record.Exception(() => Assert.Equal(date1, date2, precision)); 1960 var ex2 = Record.Exception(() => Assert.Equal(date2, date1, precision)); 1988 var ex = Record.Exception(() => Assert.Equal(0.11111M, 0.11444M, 3)); 2017 var ex = Record.Exception(() => Assert.Equal(0.11111, 0.11444, 3)); 2044 var ex = Record.Exception(() => Assert.Equal(0.11113, 0.11115, 4, MidpointRounding.ToEven)); 2061 var ex = Record.Exception(() => Assert.Equal(0.0, 1.0, double.NegativeInfinity)); 2081 var ex = Record.Exception(() => Assert.Equal(0.11113, 0.11115, 0.00001)); 2105 var ex = Record.Exception(() => Assert.Equal(20210102.2208, double.NaN, 20000000.0)); 2129 var ex = Record.Exception(() => Assert.Equal(double.PositiveInfinity, 77.7, 1.0)); 2147 var ex = Record.Exception(() => Assert.Equal(0.0, double.NegativeInfinity, 1.0)); 2177 var ex = Record.Exception(() => Assert.Equal(0.11111f, 0.11444f, 3)); 2204 var ex = Record.Exception(() => Assert.Equal(0.111133f, 0.111155f, 4, MidpointRounding.ToEven)); 2221 var ex = Record.Exception(() => Assert.Equal(0.0f, 1.0f, float.NegativeInfinity)); 2241 var ex = Record.Exception(() => Assert.Equal(0.11113f, 0.11115f, 0.00001f)); 2265 var ex = Record.Exception(() => Assert.Equal(20210102.2208f, float.NaN, 20000000.0f)); 2289 var ex = Record.Exception(() => Assert.Equal(float.PositiveInfinity, 77.7f, 1.0f)); 2307 var ex = Record.Exception(() => Assert.Equal(0.0f, float.NegativeInfinity, 1.0f)); 2327 var ex = Record.Exception(() => Assert.NotEqual(42, 42)); 2356 var ex = Record.Exception(() => Assert.NotEqual(42, 21, new Comparer<int>(true))); 2390 var ex = Record.Exception(() => Assert.NotEqual(42, 42, new ThrowingIntComparer())); 2413 var ex = Record.Exception(() => Assert.NotEqual(new[] { 1, 2 }, new[] { 1, 2 }, new ThrowingEnumerableComparer())); 2436 var ex = Record.Exception(() => Assert.NotEqual("42", "42", new ThrowingStringComparer())); 2468 var ex = Record.Exception(() => Assert.NotEqual(42, 21, (x, y) => true)); 2488 var ex = Record.Exception(() => Assert.NotEqual(42, 42, (e, a) => throw new DivideByZeroException())); 2503 var ex = Record.Exception( 2524 var ex = Record.Exception(() => Assert.NotEqual("42", "42", (e, a) => throw new DivideByZeroException())); 2545 var ex = Record.Exception(() => Assert.NotEqual(obj1, obj2)); 2574 var ex = Record.Exception(action); 2609 var ex = Record.Exception(action); 2640 var ex = Record.Exception(() => Assert.NotEqual(obj1, obj2)); 2667 var ex = Record.Exception(() => Assert.NotEqual<ComparableBaseClass>(expected, actual)); 2693 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2719 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2747 var ex = Record.Exception(action); 2784 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2814 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2840 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2869 var ex = Record.Exception(() => Assert.NotEqual(nco1, nco2)); 2898 var ex = Record.Exception(() => Assert.NotEqual(obj1, obj2)); 2927 var ex = Record.Exception(() => Assert.NotEqual<EquatableBaseClass>(expected, actual)); 2953 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 2979 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3009 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3039 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3074 var ex = Record.Exception(action); 3109 var ex = Record.Exception(action); 3158 var ex = Record.Exception(action); 3189 var ex = Record.Exception(() => Assert.NotEqual(x, y)); 3217 var ex = Record.Exception(action); 3248 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3278 var ex = Record.Exception(() => Assert.NotEqual(expected, (object)actual)); 3307 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3358 var ex = Record.Exception(action); 3393 var ex = Record.Exception(action); 3424 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3453 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3479 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3507 var ex = Record.Exception(action); 3544 var ex = Record.Exception(() => Assert.NotEqual(expected, actual, (string l, string r) => false)); 3565 var ex = Record.Exception(action); 3604 var ex = Record.Exception(action); 3656 var ex = Record.Exception(action); 3695 var ex = Record.Exception(action); 3737 var ex = Record.Exception(() => Assert.NotEqual(expected, actual, (string l, string r) => false)); 3753 var ex = Record.Exception(() => Assert.NotEqual("actual", "actual")); 3773 var ex = Record.Exception( 3799 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3827 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3858 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3888 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3925 var ex = Record.Exception(() => Assert.NotEqual(expected, actual)); 3956 var ex = Record.Exception(() => Assert.NotEqual(0.11111M, 0.11444M, 2)); 3985 var ex = Record.Exception(() => Assert.NotEqual(0.11111, 0.11444, 2)); 4012 var ex = Record.Exception(() => Assert.NotEqual(10.565, 10.566, 2, MidpointRounding.AwayFromZero)); 4035 var ex = Record.Exception(() => Assert.NotEqual(0.0, 1.0, double.NegativeInfinity)); 4049 var ex = Record.Exception(() => Assert.NotEqual(10.566, 10.565, 0.01)); 4073 var ex = Record.Exception(() => Assert.NotEqual(double.NaN, double.NaN, 1000.0)); 4097 var ex = Record.Exception(() => Assert.NotEqual(double.MinValue, double.MaxValue, double.PositiveInfinity)); 4133 var ex = Record.Exception(() => Assert.NotEqual(0.11111f, 0.11444f, 2)); 4160 var ex = Record.Exception(() => Assert.NotEqual(10.5655f, 10.5666f, 2, MidpointRounding.AwayFromZero)); 4183 var ex = Record.Exception(() => Assert.NotEqual(0.0f, 1.0f, float.NegativeInfinity)); 4197 var ex = Record.Exception(() => Assert.NotEqual(10.569f, 10.562f, 0.01f)); 4221 var ex = Record.Exception(() => Assert.NotEqual(float.NaN, float.NaN, 1000.0f)); 4245 var ex = Record.Exception(() => Assert.NotEqual(float.MinValue, float.MaxValue, float.PositiveInfinity)); 4275 var ex = Record.Exception(() => Assert.NotStrictEqual("actual", "actual")); 4301 var ex = Record.Exception(() => Assert.NotStrictEqual(new DerivedClass(), new BaseClass())); 4327 var ex = Record.Exception(() => Assert.StrictEqual("bob", "jim")); 4342 var ex = Record.Exception(() => Assert.StrictEqual(new EnumerableClass("ploeh"), new EnumerableClass("fnaah")));
EquivalenceAssertsTests.cs (69)
29 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 61 var ex = Record.Exception(() => Assert.Equivalent(12, 13)); 89 var ex = Record.Exception(() => Assert.Equivalent(1m, 2m)); 104 var ex = Record.Exception(() => Assert.Equivalent(1m, new object())); 133 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 162 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 185 var ex = Record.Exception(() => Assert.Equivalent("Hello, world", "Hello, world!")); 199 var ex = Record.Exception(() => Assert.Equivalent(null, string.Empty)); 222 var ex = Record.Exception(() => Assert.Equivalent(new { x = 42 }, new { x = 2112 })); 245 var ex = Record.Exception(() => Assert.Equivalent(new { x = new { y = 42 } }, new { x = new { y = 2112 } })); 277 var ex = Record.Exception(() => Assert.Equivalent(new { x = 42, y = 2600 }, new { y = 2600, x = 2112 })); 300 var ex = Record.Exception(() => Assert.Equivalent(new { x = new { y = 2600 }, z = 42 }, new { z = 42, x = new { y = 2112 } })); 349 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 378 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 407 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 436 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 465 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 505 var ex = Record.Exception( 526 var ex = Record.Exception( 550 var ex = Record.Exception( 588 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }, new[] { 9, 4, 1 }, strict: false)); 605 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 637 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }, new[] { 9, 4, 1 }, strict: true)); 651 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 9, 4 }, new[] { 6, 9, 4, 1 }, strict: true)); 668 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 685 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 719 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: false)); 736 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 768 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 6 }.ToImmutableArray(), new[] { 9, 4, 1 }.ToImmutableArray(), strict: true)); 782 var ex = Record.Exception(() => Assert.Equivalent(new[] { 1, 9, 4 }.ToImmutableArray(), new[] { 6, 9, 4, 1 }.ToImmutableArray(), strict: true)); 799 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 816 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 856 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 873 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 911 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 928 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 945 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 962 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1000 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1017 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1055 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1072 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1089 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1106 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1197 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1214 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1231 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1248 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1286 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1303 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1320 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1337 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1366 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1383 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: false)); 1412 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1429 var ex = Record.Exception(() => Assert.Equivalent(expected, actual, strict: true)); 1460 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1477 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1515 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1552 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1574 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1587 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1605 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1638 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1650 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1665 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1697 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1726 var ex = Record.Exception(() => Assert.Equivalent(expected, actual)); 1755 var ex = Record.Exception(() => Assert.Equivalent(expected, actual));
EventAssertsTests.cs (16)
15 var ex = Record.Exception( 37 var ex = Record.Exception( 72 var ex = Record.Exception( 97 var ex = Record.Exception( 137 var ex = Record.Exception( 182 var ex = Record.Exception( 241 var ex = Record.Exception( 263 var ex = Record.Exception( 356 var ex = await Record.ExceptionAsync( 415 var ex = await Record.ExceptionAsync( 437 var ex = await Record.ExceptionAsync( 530 var ex = await Record.ExceptionAsync( 552 var ex = await Record.ExceptionAsync( 587 var ex = await Record.ExceptionAsync( 612 var ex = await Record.ExceptionAsync( 652 var ex = await Record.ExceptionAsync(
ExceptionAssertsTests.cs (41)
19 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Action)!)); 27 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 52 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 70 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 91 Assert.Throws<ArgumentNullException>("testCode", () => Assert.Throws(typeof(Exception), default(Func<object>)!)); 99 var ex = Record.Exception(() => Assert.Throws(typeof(Exception), testCode)); 110 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 135 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 153 var ex = Record.Exception(() => Assert.Throws(typeof(ArgumentException), testCode)); 183 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 208 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 226 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 252 var ex = Record.Exception(() => Assert.Throws<Exception>(testCode)); 263 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 288 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 306 var ex = Record.Exception(() => Assert.Throws<ArgumentException>(testCode)); 335 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 359 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName2", testCode)); 377 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 395 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 421 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 445 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName2", testCode)); 463 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 481 var ex = Record.Exception(() => Assert.Throws<ArgumentException>("paramName", testCode)); 510 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 535 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 569 var ex = Record.Exception(() => Assert.ThrowsAny<Exception>(testCode)); 580 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 605 var ex = Record.Exception(() => Assert.ThrowsAny<ArgumentException>(testCode)); 640 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAnyAsync<ArgumentException>(testCode)); 665 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAnyAsync<ArgumentException>(testCode)); 699 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>(testCode)); 724 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>(testCode)); 742 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>(testCode)); 768 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode)); 792 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName2", testCode)); 810 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode)); 828 var ex = await Record.ExceptionAsync(() => Assert.ThrowsAsync<ArgumentException>("paramName", testCode));
FailAssertsTests.cs (2)
9 var ex = Record.Exception(() => Assert.Fail()); 18 var ex = Record.Exception(() => Assert.Fail("This is a user message"));
IdentityAssertsTests.cs (2)
14 var ex = Record.Exception(() => Assert.NotSame(actual, actual)); 40 var ex = Record.Exception(() => Assert.Same("bob", "jim"));
MemoryAssertsTests.cs (31)
30 var ex = Record.Exception(() => Assert.Contains("WORLD".AsMemory(), "Hello, world!".AsMemory())); 44 var ex = Record.Exception(() => Assert.Contains("WORLD".Memoryify(), "Hello, world!".Memoryify())); 70 var ex = Record.Exception(() => Assert.Contains("foo".AsMemory(), default(string).AsMemory())); 84 var ex = Record.Exception(() => Assert.Contains("foo".Memoryify(), default(string).Memoryify())); 98 var ex = Record.Exception( 144 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.AsMemory(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsMemory())); 158 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.Memoryify(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.Memoryify())); 172 var ex = Record.Exception(() => Assert.Contains(new int[] { 3, 4 }.Memoryify(), Memory<int>.Empty)); 223 var ex = Record.Exception(() => Assert.DoesNotContain("WORLD".AsMemory(), "Hello, world!".AsMemory(), StringComparison.OrdinalIgnoreCase)); 238 var ex = Record.Exception(() => Assert.DoesNotContain("WORLD".Memoryify(), "Hello, world!".Memoryify(), StringComparison.OrdinalIgnoreCase)); 253 var ex = Record.Exception(() => Assert.DoesNotContain("world".AsMemory(), "Hello, world!".AsMemory())); 268 var ex = Record.Exception(() => Assert.DoesNotContain("world".Memoryify(), "Hello, world!".Memoryify())); 295 var ex = Record.Exception(() => Assert.DoesNotContain("world".Memoryify(), "Hello, world from a very long string that will end up being truncated".Memoryify())); 310 var ex = Record.Exception(() => Assert.DoesNotContain("world".Memoryify(), "This is a relatively long string that has 'Hello, world' placed in the middle so that we can dual trunaction".Memoryify())); 325 var ex = Record.Exception(() => Assert.DoesNotContain("world".Memoryify(), "This is a relatively long string that will from the front truncated, just to say 'Hello, world'".Memoryify())); 367 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.AsMemory(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsMemory())); 382 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.Memoryify(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.Memoryify())); 405 var ex = Record.Exception(() => Assert.DoesNotContain(Memory<int>.Empty, data.ToArray().Memoryify())); 435 var ex = Record.Exception(action); 457 var ex = Record.Exception(action); 488 var ex = Record.Exception(action); 511 var ex = Record.Exception(action); 639 var ex = Record.Exception(action); 659 var ex = Record.Exception(action); 736 var ex = Record.Exception(action); 760 var ex = Record.Exception(action); 816 var ex = Record.Exception(action); 852 var ex = Record.Exception(action); 874 var ex = Record.Exception(action); 905 var ex = Record.Exception(action); 928 var ex = Record.Exception(action);
MultipleAssertsTests.cs (3)
23 var ex = Record.Exception(() => 44 var ex = Record.Exception(() => 57 var ex = Record.Exception(() =>
NullAssertsTests.cs (4)
29 var ex = Record.Exception(() => Assert.NotNull(null)); 40 var ex = Record.Exception(() => Assert.NotNull(value)); 66 var ex = Record.Exception(() => Assert.Null(new object())); 82 var ex = Record.Exception(() => Assert.Null(x));
PropertyAssertsTests.cs (4)
24 var ex = Record.Exception(() => Assert.PropertyChanged(obj, nameof(NotifiedClass.Property1), () => { })); 35 var ex = Record.Exception(() => Assert.PropertyChanged(obj, nameof(NotifiedClass.Property1), () => obj.Property2 = 42)); 77 var ex = await Record.ExceptionAsync(() => Assert.PropertyChangedAsync(obj, nameof(NotifiedClass.Property1), () => Task.FromResult(0))); 90 var ex = await Record.ExceptionAsync(() => Assert.PropertyChangedAsync(obj, nameof(NotifiedClass.Property1), setter));
RangeAssertsTests.cs (9)
17 var ex = Record.Exception(() => Assert.InRange(1.50, .75, 1.25)); 37 var ex = Record.Exception(() => Assert.InRange(0, 1, 2)); 51 var ex = Record.Exception(() => Assert.InRange(2, 0, 1)); 71 var ex = Record.Exception(() => Assert.InRange("adam", "bob", "scott")); 104 var ex = Record.Exception(() => Assert.InRange(1.0, .75, 1.25, new DoubleComparer(1))); 127 var ex = Record.Exception(() => Assert.NotInRange(1.0, .75, 1.25)); 147 var ex = Record.Exception(() => Assert.NotInRange(2, 1, 3)); 167 var ex = Record.Exception(() => Assert.NotInRange("bob", "adam", "scott")); 184 var ex = Record.Exception(() => Assert.NotInRange(400.0, .75, 1.25, new DoubleComparer(-1)));
SetAssertsTests.cs (11)
38 var ex = Record.Exception(action); 88 var ex = Record.Exception(action); 126 var ex = Record.Exception(() => Assert.ProperSubset(expectedSubset, actual)); 152 var ex = Record.Exception(() => Assert.ProperSubset(expectedSubset, actual)); 166 var ex = Record.Exception(() => Assert.ProperSubset(new HashSet<int>(), null)); 192 var ex = Record.Exception(() => Assert.ProperSuperset(expectedSuperset, actual)); 218 var ex = Record.Exception(() => Assert.ProperSuperset(expectedSuperset, actual)); 232 var ex = Record.Exception(() => Assert.ProperSuperset(new HashSet<int>(), null)); 276 var ex = Record.Exception(() => Assert.Subset(expectedSubset, actual)); 290 var ex = Record.Exception(() => Assert.Subset(new HashSet<int>(), null)); 347 var ex = Record.Exception(() => Assert.Superset(new HashSet<int>(), null));
SpanAssertsTests.cs (31)
30 var ex = Record.Exception(() => Assert.Contains("WORLD".AsSpan(), "Hello, world!".AsSpan())); 44 var ex = Record.Exception(() => Assert.Contains("WORLD".Spanify(), "Hello, world!".Spanify())); 70 var ex = Record.Exception(() => Assert.Contains("foo".AsSpan(), default(string).AsSpan())); 84 var ex = Record.Exception(() => Assert.Contains("foo".Spanify(), default(string).Spanify())); 98 var ex = Record.Exception( 144 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan())); 158 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.Spanify(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.Spanify())); 172 var ex = Record.Exception(() => Assert.Contains(new int[] { 3, 4 }.Spanify(), Span<int>.Empty)); 223 var ex = Record.Exception(() => Assert.DoesNotContain("WORLD".AsSpan(), "Hello, world!".AsSpan(), StringComparison.OrdinalIgnoreCase)); 238 var ex = Record.Exception(() => Assert.DoesNotContain("WORLD".Spanify(), "Hello, world!".Spanify(), StringComparison.OrdinalIgnoreCase)); 253 var ex = Record.Exception(() => Assert.DoesNotContain("world".AsSpan(), "Hello, world!".AsSpan())); 268 var ex = Record.Exception(() => Assert.DoesNotContain("world".Spanify(), "Hello, world!".Spanify())); 295 var ex = Record.Exception(() => Assert.DoesNotContain("world".AsSpan(), "Hello, world from a very long string that will end up being truncated".AsSpan())); 310 var ex = Record.Exception(() => Assert.DoesNotContain("world".AsSpan(), "This is a relatively long string that has 'Hello, world' placed in the middle so that we can dual trunaction".AsSpan())); 325 var ex = Record.Exception(() => Assert.DoesNotContain("world".AsSpan(), "This is a relatively long string that will from the front truncated, just to say 'Hello, world'".AsSpan())); 367 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan())); 382 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.Spanify(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.Spanify())); 405 var ex = Record.Exception(() => Assert.DoesNotContain(Span<int>.Empty, data.ToArray().Spanify())); 435 var ex = Record.Exception(action); 457 var ex = Record.Exception(action); 488 var ex = Record.Exception(action); 511 var ex = Record.Exception(action); 639 var ex = Record.Exception(action); 659 var ex = Record.Exception(action); 736 var ex = Record.Exception(action); 760 var ex = Record.Exception(action); 816 var ex = Record.Exception(action); 852 var ex = Record.Exception(action); 874 var ex = Record.Exception(action); 905 var ex = Record.Exception(action); 928 var ex = Record.Exception(action);
StringAssertsTests.cs (26)
31 var ex = Record.Exception(action); 60 var ex = Record.Exception(action); 87 var ex = Record.Exception(() => Assert.Contains("foo", default(string))); 106 var ex = Record.Exception(action); 186 var ex = Record.Exception(action); 222 var ex = Record.Exception(action); 252 var ex = Record.Exception(action); 282 var ex = Record.Exception(action); 312 var ex = Record.Exception(action); 355 var ex = Record.Exception(() => Assert.DoesNotMatch("ll", "Hello, world!")); 385 var ex = Record.Exception(() => Assert.DoesNotMatch(new Regex(@"ll"), "Hello, world!")); 415 var ex = Record.Exception(() => Assert.Empty("Foo")); 449 var ex = Record.Exception(action); 478 var ex = Record.Exception(action); 521 var ex = Record.Exception(() => Assert.EndsWith("foo", null)); 540 var ex = Record.Exception(action); 679 var ex = Record.Exception(action); 709 var ex = Record.Exception(action); 753 var ex = Record.Exception(() => Assert.Matches(@"\d+", "Hello, world!")); 767 var ex = Record.Exception(() => Assert.Matches(@"\d+", null)); 802 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), "Hello, world!")); 816 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), null)); 851 var ex = Record.Exception(action); 880 var ex = Record.Exception(action); 923 var ex = Record.Exception(() => Assert.StartsWith(default(string), default(string))); 942 var ex = Record.Exception(action);
TypeAssertsTests.cs (22)
20 var result = Record.Exception(() => Assert.IsAssignableFrom<object>(null)); 44 Assert.IsAssignableFrom<Exception>(ex); 68 var result = 89 var result = Record.Exception(() => Assert.IsAssignableFrom(typeof(object), null)); 113 Assert.IsAssignableFrom(typeof(Exception), ex); 137 var result = 166 var result = Record.Exception(() => Assert.IsNotAssignableFrom<InvalidCastException>(ex)); 182 var result = Record.Exception(() => Assert.IsNotAssignableFrom<Exception>(ex)); 198 var result = Record.Exception(() => Assert.IsNotAssignableFrom<IDisposable>(ex)); 229 var result = Record.Exception(() => Assert.IsNotAssignableFrom(typeof(InvalidCastException), ex)); 245 var result = Record.Exception(() => Assert.IsNotAssignableFrom(typeof(Exception), ex)); 261 var result = Record.Exception(() => Assert.IsNotAssignableFrom(typeof(IDisposable), ex)); 286 Assert.IsNotType<Exception>(ex); 292 var result = Record.Exception(() => Assert.IsNotType<InvalidCastException>(new InvalidCastException())); 318 Assert.IsNotType(typeof(Exception), ex); 324 var result = Record.Exception(() => Assert.IsNotType(typeof(InvalidCastException), new InvalidCastException())); 366 var result = Record.Exception(() => Assert.IsType<InvalidCastException>(new InvalidOperationException())); 402 var result = Record.Exception(() => Assert.IsType<object>(null)); 428 var result = Record.Exception(() => Assert.IsType(typeof(InvalidCastException), new InvalidOperationException())); 464 var result = Record.Exception(() => Assert.IsType(typeof(object), null));
Microsoft.DotNet.XUnitExtensions (5)
Discoverers\ConditionalTestDiscoverer.cs (1)
78catch (Exception exc)
XunitParallelTheoryTestCaseRunner.cs (4)
23private Exception _dataDiscoveryException; 112catch (Exception ex) 169private static Exception Unwrap(Exception ex)
Microsoft.Extensions.AI (25)
ChatCompletion\AnonymousDelegatingChatClient.cs (2)
136Exception? error = null; 147catch (Exception ex)
ChatCompletion\FunctionInvokingChatClient.cs (6)
111/// case, the raw <see cref="Exception"/> object is available to application code by inspecting 577catch (Exception e) when (!cancellationToken.IsCancellationRequested) 682catch (Exception e) 744private partial void LogInvocationFailed(string methodName, Exception error); 806internal FunctionInvocationResult(ContinueMode continueMode, FunctionStatus status, FunctionCallContent callContent, object? result, Exception? exception) 825public Exception? Exception { get; }
ChatCompletion\LoggingChatClient.cs (4)
84catch (Exception ex) 117catch (Exception ex) 142catch (Exception ex) 195private partial void LogInvocationFailed(string methodName, Exception error);
ChatCompletion\OpenTelemetryChatClient.cs (6)
134Exception? error = null; 140catch (Exception ex) 169catch (Exception ex) 177Exception? error = null; 192catch (Exception ex) 318Exception? error,
Embeddings\LoggingEmbeddingGenerator.cs (2)
76catch (Exception ex) 98private partial void LogInvocationFailed(Exception error);
Embeddings\OpenTelemetryEmbeddingGenerator.cs (3)
93Exception? error = null; 98catch (Exception ex) 182Exception? error,
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.Abstractions (7)
AdditionalPropertiesDictionary{TValue}.cs (1)
180catch (Exception e) when (e is ArgumentException or FormatException or InvalidCastException or OverflowException)
Contents\FunctionCallContent.cs (3)
57public Exception? Exception { get; set; } 80Exception? parsingException = null; 87catch (Exception ex)
Contents\FunctionResultContent.cs (1)
69public Exception? Exception { get; set; }
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.Abstractions.Tests (5)
Contents\FunctionCallContentTests..cs (4)
73Exception e = new(); 319var exc = (Exception)Activator.CreateInstance(exceptionType)!; 328static Dictionary<string, object?> ThrowingParser(Exception ex) => throw ex;
Contents\FunctionResultContentTests.cs (1)
60Exception e = new();
Microsoft.Extensions.AI.AzureAIInference (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.Integration.Tests (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.Ollama (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.OpenAI (3)
OpenAIRealtimeExtensions.cs (1)
134catch (Exception e) when (!cancellationToken.IsCancellationRequested)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
381void Validate(Exception ex)
Microsoft.Extensions.AmbientMetadata.Application (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AsyncState (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.AsyncState.Tests (4)
AsyncStateTests.cs (4)
68catch (Exception ex) 118catch (Exception ex) 161catch (Exception ex) 190catch (Exception ex)
Microsoft.Extensions.Caching.Hybrid (14)
Internal\DefaultHybridCache.MutableCacheItem.cs (1)
44catch (Exception ex)
Internal\DefaultHybridCache.Serialization.cs (1)
74catch (Exception ex)
Internal\DefaultHybridCache.StampedeStateT.cs (5)
202catch (Exception ex) 239catch (Exception ex) 312catch (Exception ex) 350catch (Exception ex) 356private void SetException(Exception ex)
Internal\Log.cs (5)
21internal static partial void MaximumPayloadBytesExceeded(this ILogger logger, Exception e, int bytes); 28internal static partial void SerializationFailure(this ILogger logger, Exception e); 32internal static partial void DeserializationFailure(this ILogger logger, Exception e); 42internal static partial void CacheUnderlyingDataQueryFailure(this ILogger logger, Exception ex); 45internal static partial void CacheBackendWriteFailure(this ILogger logger, Exception ex);
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Caching.Hybrid.Tests (5)
LogCollector.cs (4)
12private readonly List<(string categoryName, LogLevel logLevel, EventId eventId, Exception? exception, string message)> _items = []; 14public (string categoryName, LogLevel logLevel, EventId eventId, Exception? exception, string message)[] ToArray() 76void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
SqlServerTests.cs (1)
45catch (Exception ex)
Microsoft.Extensions.Caching.Memory (1)
CacheEntry.CacheEntryTokens.cs (1)
132catch (Exception e)
Microsoft.Extensions.Caching.StackExchangeRedis (15)
RedisCache.cs (13)
194catch (Exception ex) 242catch (Exception ex) 386catch (Exception ex) 405catch (Exception ex) 444catch (Exception ex) 477catch (Exception ex) 496catch (Exception ex) 538catch (Exception ex) 566catch (Exception ex) 633private void OnRedisError(Exception exception, IDatabase cache) 694catch (Exception ex) 721catch (Exception ex) 768catch (Exception ex)
RedisCache.Log.cs (2)
14public static partial void CouldNotDetermineServerVersion(ILogger logger, Exception exception); 17internal static partial void UnableToAddLibraryNameSuffix(ILogger logger, Exception exception);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Infrastructure\RedisTestConfig.cs (1)
190catch (Exception e)
Microsoft.Extensions.Compliance.Abstractions (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Compliance.Redaction (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Compliance.Redaction.Tests (1)
HmacRedactorTest.cs (1)
79var e = Record.Exception(() => redactor.Redact(toRedact.AsSpan(), tooSmallBuffer));
Microsoft.Extensions.Compliance.Testing (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Configuration.Binder (9)
ConfigurationBinder.cs (9)
343if (configValue != null && TryConvertValue(type, configValue, section?.Path, out object? convertedValue, out Exception? error)) 572catch (Exception ex) 750catch (Exception ex) 789catch (Exception ex) 845catch (Exception ex) 916catch (Exception ex) 933string value, string? path, out object? result, out Exception? error) 959catch (Exception ex) 988TryConvertValue(type, value, path, out object? result, out Exception? error);
Microsoft.Extensions.Configuration.FileExtensions (2)
FileConfigurationProvider.cs (1)
101catch (Exception ex)
FileLoadExceptionContext.cs (1)
21public Exception Exception { get; set; } = null!;
Microsoft.Extensions.Configuration.KeyPerFile.Tests (2)
ConfigurationProviderTestBase.cs (2)
114Exception caught = null; 119catch (Exception e)
Microsoft.Extensions.DependencyInjection (7)
DependencyInjectionEventSource.cs (1)
134public void ServiceRealizationFailed(Exception exception, int serviceProviderHashCode)
ServiceLookup\DynamicServiceProviderEngine.cs (1)
40catch (Exception ex)
ServiceLookup\ServiceProviderEngineScope.cs (1)
169catch (Exception ex)
ServiceProvider.cs (4)
75List<Exception>? exceptions = null; 82catch (Exception e) 84exceptions ??= new List<Exception>(); 201catch (Exception e)
Microsoft.Extensions.DependencyInjection.AutoActivation (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (10)
ExceptionSummarizer.cs (2)
31public ExceptionSummary Summarize(Exception exception) 84Exception exception,
ExceptionSummary.cs (1)
14/// to represent values that are highly variable, such as the result of <see cref="Exception.ToString"/>.
HttpExceptionSummaryProvider.cs (1)
82public int Describe(Exception exception, out string? additionalDetails)
IExceptionSummarizer.cs (3)
14/// Gives the best available summary of a given <see cref="Exception"/> for telemetry. 17/// <returns>The summary of the given <see cref="Exception"/>.</returns> 18public ExceptionSummary Summarize(Exception exception);
IExceptionSummaryProvider.cs (1)
29public int Describe(Exception exception, out string? additionalDetails);
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Diagnostics.HealthChecks (11)
DefaultHealthCheckService.cs (5)
136catch (Exception ex) when (ex as OperationCanceledException == null) 226private static partial void HealthCheckEndDegraded(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription, Exception? exception); 229private static partial void HealthCheckEndUnhealthy(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription, Exception? exception); 252private static partial void HealthCheckError(ILogger logger, string HealthCheckName, double ElapsedMilliseconds, Exception exception); 254public static void HealthCheckError(ILogger logger, HealthCheckRegistration registration, Exception exception, TimeSpan duration) =>
HealthCheckPublisherHostedService.cs (6)
167catch (Exception ex) 225catch (Exception ex) 255public static void HealthCheckPublisherProcessingEnd(ILogger logger, TimeSpan duration, Exception? exception = null) => 259private static partial void HealthCheckPublisherProcessingEnd(ILogger logger, double ElapsedMilliseconds, Exception? exception = null); 270public static void HealthCheckPublisherError(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration, Exception exception) => 275private static partial void HealthCheckPublisherError(ILogger logger, IHealthCheckPublisher HealthCheckPublisher, double ElapsedMilliseconds, Exception exception);
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (8)
HealthCheckResult.cs (4)
24public HealthCheckResult(HealthStatus status, string? description = null, Exception? exception = null, IReadOnlyDictionary<string, object>? data = null) 45public Exception? Exception { get; } 70public static HealthCheckResult Degraded(string? description = null, Exception? exception = null, IReadOnlyDictionary<string, object>? data = null) 82public static HealthCheckResult Unhealthy(string? description = null, Exception? exception = null, IReadOnlyDictionary<string, object>? data = null)
HealthReportEntry.cs (4)
26public HealthReportEntry(HealthStatus status, string? description, TimeSpan duration, Exception? exception, IReadOnlyDictionary<string, object>? data) 41public HealthReportEntry(HealthStatus status, string? description, TimeSpan duration, Exception? exception, IReadOnlyDictionary<string, object>? data, IEnumerable<string>? tags = null) 67/// Gets an <see cref="System.Exception"/> representing the exception that was thrown when checking for status (if any). 69public Exception? Exception { get; }
Microsoft.Extensions.Diagnostics.HealthChecks.Common (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (3)
DefaultHealthCheckServiceTest.cs (2)
61var exception = new Exception("Things are pretty bad!"); 167var exception = new Exception("Things are pretty bad!");
HealthCheckPublisherHostedServiceTest.cs (1)
806public Exception? Exception { get; set; }
Microsoft.Extensions.Diagnostics.Probes (3)
Log.cs (1)
12public static partial void SocketExceptionCaughtTcpEndpoint(this ILogger logger, Exception e);
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Diagnostics.Probes.Tests (1)
KubernetesProbesOptionsValidatorTests.cs (1)
90catch (Exception ex)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (6)
Log.cs (2)
15public static partial void HandledGatherStatisticsException(ILogger logger, Exception e); 18public static partial void HandlePublishUtilizationException(ILogger logger, Exception e, string publisher);
ResourceMonitorService.cs (2)
114catch (Exception e) 138catch (Exception e)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (33)
Linux\LinuxUtilizationParserCgroupV1Tests.cs (11)
86var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 113var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 132var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 158var r = Record.Exception(() => p.GetHostAvailableMemory()); 232var r = Record.Exception(() => p.GetCgroupLimitedCpus()); 253var r = Record.Exception(() => p.GetCgroupLimitedCpus()); 281var r = Record.Exception(() => p.GetCgroupLimitedCpus()); 296var r = Record.Exception(() => p.GetHostCpuUsageInNanoseconds()); 311var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 331var r = Record.Exception(() => p.GetHostCpuUsageInNanoseconds()); 348var r = Record.Exception(() => p.GetCgroupRequestCpu());
Linux\LinuxUtilizationParserCgroupV2Tests.cs (14)
90var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 115var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 149var r = Record.Exception(() => p.GetAvailableMemoryInBytes()); 164var r = Record.Exception(() => p.GetMemoryUsageInBytesFromSlices(regexPatternforSlices)); 197var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 222var r = Record.Exception(() => p.GetHostAvailableMemory()); 307var r = Record.Exception(() => p.GetHostCpuCount()); 322var r = Record.Exception(() => p.GetCgroupLimitedCpus()); 347var r = Record.Exception(() => p.GetCgroupLimitedCpus()); 376var r = Record.Exception(() => p.GetMemoryUsageInBytes()); 396var r = Record.Exception(() => p.GetHostCpuUsageInNanoseconds()); 413var r = Record.Exception(() => p.GetCgroupCpuUsageInNanoseconds()); 430var r = Record.Exception(() => p.GetCgroupCpuUsageInNanoseconds()); 448var r = Record.Exception(() => p.GetCgroupRequestCpu());
ResourceMonitoringServiceTests.cs (7)
106var exception = Record.Exception(() => 602var exception = Record.Exception(() => 626var exception = await Record.ExceptionAsync(async () => 664var exception = Record.Exception(() => _ = tracker.GetUtilization(TimeSpan.FromSeconds(1))); 688var exception = Record.Exception(() => tracker.GetUtilization(TimeSpan.FromSeconds(6))); 711var exception = Record.Exception(() => tracker.GetUtilization(TimeSpan.FromSeconds(6))); 723var r = await Record.ExceptionAsync(async () =>
Windows\WindowsSnapshotProviderTests.cs (1)
59var exception = Record.Exception(() => provider.GetSnapshot());
Microsoft.Extensions.Diagnostics.Testing (6)
Logging\FakeLogger.cs (2)
63public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Logging\FakeLogRecord.cs (2)
29public FakeLogRecord(LogLevel level, EventId id, object? state, Exception? exception, string message, IReadOnlyList<object?> scopes, string? category, bool enabled, DateTimeOffset timestamp) 97public Exception? Exception { get; }
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.FileProviders.Physical (4)
Internal\FileSystemInfoHelper.cs (1)
62catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
PhysicalDirectoryInfo.cs (1)
100catch (Exception ex) when (ex is DirectoryNotFoundException or IOException)
PhysicalFilesWatcher.cs (2)
298catch (Exception ex) when ( 351catch (Exception ex) when (
Microsoft.Extensions.Hosting (20)
Internal\ApplicationLifetime.cs (3)
68catch (Exception ex) 86catch (Exception ex) 103catch (Exception ex)
Internal\Host.cs (11)
87List<Exception> exceptions = new(); 102catch (Exception ex) 158Exception singleException = exceptions[0]; 188catch (Exception ex) 231List<Exception> exceptions = new(); 280catch (Exception ex) 292Exception singleException = exceptions[0]; 313List<Exception> exceptions, 330catch (Exception ex) 359catch (Exception ex) 380catch (Exception ex)
Internal\HostingLoggerExtensions.cs (6)
13public static void ApplicationError(this ILogger logger, EventId eventId, string? message, Exception? exception) 17foreach (Exception? ex in reflectionTypeLoadException.LoaderExceptions) 72public static void StoppedWithException(this ILogger logger, Exception? ex) 83public static void BackgroundServiceFaulted(this ILogger logger, Exception? ex) 94public static void BackgroundServiceStoppingHost(this ILogger logger, Exception? ex) 105public static void HostedServiceStartupFaulted(this ILogger logger, Exception? ex)
Microsoft.Extensions.Hosting.Abstractions (1)
HostAbortedException.cs (1)
55public HostAbortedException(string? message, Exception? innerException) : base(message ?? SR.HostAbortedExceptionMessage, innerException) { }
Microsoft.Extensions.Hosting.Testing (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Hosting.Testing.Tests (10)
FakeHostBuilderTests.cs (4)
135var exception = Record.Exception(() => hostBuilder.Build()); 153var exception = Record.Exception(() => hostBuilder.Build()); 167var exception = Record.Exception(() => hostBuilder.Build()); 184var exception = Record.Exception(() => hostBuilder.Build());
HostingFakesExtensionsTests.cs (6)
21var exception = await Record.ExceptionAsync(() => ((IHostedService)null!).StartAndStopAsync()); 51var exception = Record.Exception(() => host.GetFakeLogCollector()); 73var exception = Record.Exception(() => host.GetFakeRedactionCollector()); 93var exception = Record.Exception(() => ((IHostBuilder)null!).Configure(_ => { })); 100var exception = Record.Exception(() => new HostBuilder().Configure(null!)); 109var exception = Record.Exception(() => builderMock.Object.Configure(null!));
Microsoft.Extensions.Hosting.WindowsServices (2)
Internal\Win32.cs (1)
42catch (Exception)
WindowsServiceLifetime.cs (1)
104catch (Exception ex)
Microsoft.Extensions.Http (16)
DefaultHttpClientFactory.cs (6)
289catch (Exception ex) 326private static readonly Action<ILogger, int, Exception?> _cleanupCycleStart = LoggerMessage.Define<int>( 331private static readonly Action<ILogger, double, int, int, Exception?> _cleanupCycleEnd = LoggerMessage.Define<double, int, int>( 336private static readonly Action<ILogger, string, Exception> _cleanupItemFailed = LoggerMessage.Define<string>( 341private static readonly Action<ILogger, double, string, Exception?> _handlerExpired = LoggerMessage.Define<double, string>( 363public static void CleanupItemFailed(Lazy<ILogger> loggerLazy, string clientName, Exception exception)
Logging\HttpClientLoggerHandler.cs (2)
50catch (Exception exception) 82catch (Exception exception)
Logging\IHttpClientAsyncLogger.cs (1)
63ValueTask LogRequestFailedAsync(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed, CancellationToken cancellationToken = default);
Logging\IHttpClientLogger.cs (1)
49void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed);
Logging\LogHelper.cs (6)
41private static readonly Action<ILogger, HttpMethod, string?, Exception?> _requestStart = LoggerMessage.Define<HttpMethod, string?>( 47private static readonly Action<ILogger, double, int, Exception?> _requestEnd = LoggerMessage.Define<double, int>( 52private static readonly Action<ILogger, double, Exception?> _requestFailed = LoggerMessage.Define<double>( 59private static readonly Action<ILogger, HttpMethod, string?, Exception?> _requestPipelineStart = LoggerMessage.Define<HttpMethod, string?>( 64private static readonly Action<ILogger, double, int, Exception?> _requestPipelineEnd = LoggerMessage.Define<double, int>( 69private static readonly Action<ILogger, double, Exception?> _requestPipelineFailed = LoggerMessage.Define<double>(
Microsoft.Extensions.Http.Diagnostics (20)
Http\DownstreamDependencyMetadataManager.cs (2)
54catch (Exception) 70catch (Exception)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
35public void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
Logging\IHttpClientLogEnricher.cs (2)
21/// <param name="exception">An optional <see cref="Exception"/> that was thrown within the outgoing HTTP request processing.</param> 26void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception);
Logging\Internal\HttpClientLogger.cs (7)
90catch (Exception ex) 124Exception exception, 135public void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed) 157Exception? exception, 197catch (Exception ex) 224HttpRequestMessage request, HttpResponseMessage? response, Exception? exception) 232catch (Exception e)
Logging\Internal\Log.cs (8)
39private static readonly Func<LoggerMessageState, Exception?, string> _originalFormatValueFmtFunc = OriginalFormatValueFmt; 46public static void OutgoingRequestError(ILogger logger, LogRecord record, Exception exception) 54Exception exception, 62Exception exception, 70Exception? exception, 78Exception exception, 86ILogger logger, LogLevel level, int eventId, string eventName, LogRecord record, Exception? exception = null) 152private static string OriginalFormatValueFmt(LoggerMessageState request, Exception? _)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
BenchEnricher.cs (1)
15public void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
DropMessageLogger.cs (3)
11internal static readonly Func<LogLevel, EventId, object, Exception, object?> CreateLogRecord 23public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Http.Diagnostics.Tests (14)
Logging\HttpClientLoggerTest.cs (11)
153var exception = await Record.ExceptionAsync(act); 699enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 700enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 742enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 743enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 752.Setup(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>())) 785enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 786enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 795.Setup(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>())) 831enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1)); 832enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
Logging\Internal\EmptyEnricher.cs (1)
12public void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
Logging\Internal\EnricherWithCounter.cs (1)
14public void Enrich(IEnrichmentTagCollector collector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
Logging\Internal\TestEnricher.cs (1)
29public void Enrich(IEnrichmentTagCollector tagCollector, HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
Microsoft.Extensions.Http.Polly.Tests (1)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (1)
559public Func<Exception> CreateException { get; set; } = () => new OverflowException();
Microsoft.Extensions.Http.Resilience (5)
Hedging\HttpClientHedgingResiliencePredicates.cs (1)
47internal static bool IsTransientHttpException(Exception exception)
Polly\HttpClientResiliencePredicates.cs (1)
46internal static bool IsTransientHttpException(Exception exception)
Resilience\ResilienceHandler.cs (1)
81catch (Exception e)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Http.Resilience.Tests (7)
Hedging\OperationCanceledExceptionMock.cs (1)
10public OperationCanceledExceptionMock(Exception innerException)
Hedging\StandardHedgingTests.cs (1)
340var ex = await Record.ExceptionAsync(async () =>
Polly\HttpCircuitBreakerStrategyOptionsTests.cs (2)
66public async Task ShouldHandleException_DefaultValue_ShouldClassify(Exception exception, bool expectedToHandle) 72private CircuitBreakerPredicateArguments<HttpResponseMessage> CreateArgs(Exception error)
Polly\HttpClientResiliencePredicatesTests.cs (1)
34public void IsTransientHttpException_Exception_ShouldClassify(Exception ex, bool expectedCondition)
Polly\HttpRetryStrategyOptionsTests.cs (2)
67public async Task ShouldHandleException_DefaultValue_ShouldClassify(Exception exception, CancellationToken? token, bool expectedToHandle) 91public async Task ShouldHandleException_DefaultInstance_ShouldClassify(Exception exception, CancellationToken? token, bool expectedToHandle)
Microsoft.Extensions.Logging (16)
Logger.cs (16)
27public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 35List<Exception>? exceptions = null; 52static void LoggerLog(LogLevel logLevel, EventId eventId, ILogger logger, Exception? exception, Func<TState, Exception?, string> formatter, ref List<Exception>? exceptions, in TState state) 58catch (Exception ex) 60exceptions ??= new List<Exception>(); 74List<Exception>? exceptions = null; 97static bool LoggerIsEnabled(LogLevel logLevel, ILogger logger, ref List<Exception>? exceptions) 106catch (Exception ex) 108exceptions ??= new List<Exception>(); 131List<Exception>? exceptions = null; 140catch (Exception ex) 142exceptions ??= new List<Exception>(); 155private static void ThrowLoggingError(List<Exception> exceptions)
Microsoft.Extensions.Logging.Abstractions (56)
ILogger.cs (2)
23void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter);
LogEntry.cs (4)
22public LogEntry(LogLevel logLevel, string category, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 55public Exception? Exception { get; } 60public Func<TState, Exception?, string> Formatter { get; }
LoggerExtensions.cs (16)
13private static readonly Func<FormattedLogValues, Exception?, string> _messageFormatter = MessageFormatter; 30public static void LogDebug(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 64public static void LogDebug(this ILogger logger, Exception? exception, string? message, params object?[] args) 100public static void LogTrace(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 134public static void LogTrace(this ILogger logger, Exception? exception, string? message, params object?[] args) 170public static void LogInformation(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 204public static void LogInformation(this ILogger logger, Exception? exception, string? message, params object?[] args) 240public static void LogWarning(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 274public static void LogWarning(this ILogger logger, Exception? exception, string? message, params object?[] args) 310public static void LogError(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 344public static void LogError(this ILogger logger, Exception? exception, string? message, params object?[] args) 380public static void LogCritical(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args) 414public static void LogCritical(this ILogger logger, Exception? exception, string? message, params object?[] args) 468public static void Log(this ILogger logger, LogLevel logLevel, Exception? exception, string? message, params object?[] args) 482public static void Log(this ILogger logger, LogLevel logLevel, EventId eventId, Exception? exception, string? message, params object?[] args) 515private static string MessageFormatter(FormattedLogValues state, Exception? error)
LoggerMessage.cs (28)
130public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString) 141public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 145void Log(ILogger logger, Exception? exception) 172public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString) 184public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 188void Log(ILogger logger, T1 arg1, Exception? exception) 216public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString) 229public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 233void Log(ILogger logger, T1 arg1, T2 arg2, Exception? exception) 262public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString) 276public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 280void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, Exception? exception) 310public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString) 325public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 329void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Exception? exception) 360public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString) 376public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 380void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Exception? exception) 412public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString) 429public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options) 433void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, Exception? exception) 468public static readonly Func<LogValues, Exception?, string> Callback = (state, exception) => state.ToString(); 506public static readonly Func<LogValues<T0>, Exception?, string> Callback = (state, exception) => state.ToString(); 554public static readonly Func<LogValues<T0, T1>, Exception?, string> Callback = (state, exception) => state.ToString(); 605public static readonly Func<LogValues<T0, T1, T2>, Exception?, string> Callback = (state, exception) => state.ToString(); 660public static readonly Func<LogValues<T0, T1, T2, T3>, Exception?, string> Callback = (state, exception) => state.ToString(); 721public static readonly Func<LogValues<T0, T1, T2, T3, T4>, Exception?, string> Callback = (state, exception) => state.ToString(); 786public static readonly Func<LogValues<T0, T1, T2, T3, T4, T5>, Exception?, string> Callback = (state, exception) => state.ToString();
LoggerT.cs (2)
45void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
NullLogger.cs (2)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
NullLoggerT.cs (2)
33Exception? exception, 34Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Logging.AzureAppServices (4)
BatchingLogger.cs (4)
31public void Log<TState>(DateTimeOffset timestamp, LogLevel logLevel, EventId _, TState state, Exception exception, Func<TState, Exception, string> formatter) 70public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.Extensions.Logging.Console (4)
ConsoleLogger.cs (2)
46public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
JsonConsoleFormatter.cs (1)
78writer.WriteString(nameof(Exception), exception);
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
91public override void Complete(Exception? exception = null) => throw new NotImplementedException();
Microsoft.Extensions.Logging.Debug (2)
DebugLogger.cs (2)
39public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.Logging.EventLog (3)
EventLogLogger.cs (2)
74Exception? exception, 75Func<TState, Exception?, string> formatter)
WindowsEventLog.cs (1)
62catch (Exception)
Microsoft.Extensions.Logging.EventSource (4)
EventSourceLogger.cs (3)
55public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 232private static ExceptionInfo GetExceptionInfo(Exception? exception)
ExceptionInfo.cs (1)
20public ExceptionInfo(Exception exception)
Microsoft.Extensions.Logging.TraceSource (2)
TraceSourceLogger.cs (2)
27public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Extensions.ML (14)
ModelLoaders\FileModelLoader.cs (6)
89catch (Exception ex) 159private static readonly Action<ILogger, string, Exception> _fileLoadBegin = LoggerMessage.Define<string>( 164private static readonly Action<ILogger, string, double, Exception> _fileLoadEnd = LoggerMessage.Define<string, double>( 169private static readonly Action<ILogger, string, double, Exception> _fileReloadError = LoggerMessage.Define<string, double>( 174private static readonly Action<ILogger, string, double, Exception> _fileReLoad = LoggerMessage.Define<string, double>( 189public static void FileReloadError(ILogger logger, string filePath, TimeSpan duration, Exception exception)
ModelLoaders\UriModelLoader.cs (8)
95catch (Exception ex) 157catch (Exception ex) 193private static readonly Action<ILogger, Uri, Exception> _uriReloadBegin = LoggerMessage.Define<Uri>( 198private static readonly Action<ILogger, Uri, double, Exception> _uriReloadEnd = LoggerMessage.Define<Uri, double>( 203private static readonly Action<ILogger, Uri, double, Exception> _uriReloadError = LoggerMessage.Define<Uri, double>( 208private static readonly Action<ILogger, Uri, Exception> _uriLoadError = LoggerMessage.Define<Uri>( 223public static void UriReloadError(ILogger logger, Uri uri, TimeSpan duration, Exception exception) 228public static void UriLoadError(ILogger logger, Uri uri, Exception exception)
Microsoft.Extensions.ObjectPool.DependencyInjection (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Options (1)
ValidateOnStart.cs (1)
22List<Exception>? exceptions = null;
Microsoft.Extensions.Options.Contextual (5)
Internal\ContextualOptionsFactory.cs (3)
80List<Exception>? loadExceptions = null; 89catch (Exception e) 107catch (Exception e)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Primitives (2)
StringSegment.cs (2)
682Exception GetInvalidArgumentsException() 708Exception GetInvalidArgumentsException(bool hasValue)
Microsoft.Extensions.Resilience (3)
Resilience\Internal\ResilienceMetricsEnricher.cs (1)
30if (_exceptionSummarizer is not null && outcome?.Exception is Exception e)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Resilience.Tests (1)
Resilience\ResilienceMetricsEnricherTests.cs (1)
39_summarizer!.Setup(v => v.Summarize(It.IsAny<Exception>())).Returns(new ExceptionSummary("type", "desc", "details"));
Microsoft.Extensions.SecretManager.Tools.Tests (1)
UserSecretsTestFixture.cs (1)
91catch (Exception)
Microsoft.Extensions.ServiceDiscovery (7)
Internal\ServiceEndpointResolverResult.cs (2)
13internal sealed class ServiceEndpointResolverResult(ServiceEndpointSource? endpointSource, Exception? exception) 18public Exception? Exception { get; } = exception;
ServiceEndpointWatcher.cs (4)
133Exception? error = null; 178catch (Exception exception) 203catch (Exception exception) 260catch (Exception exception)
ServiceEndpointWatcher.Log.cs (1)
40public static partial void ResolutionFailed(ILogger logger, Exception exception, string serviceName);
Microsoft.Extensions.Telemetry (29)
Logging\ExtendedLogger.cs (23)
40public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 47ModernPath(logLevel, eventId, msgState, exception, (Func<LoggerMessageState, Exception?, string>)(object)formatter); 70List<Exception>? exceptions = null; 77catch (Exception ex) 95List<Exception>? exceptions = null; 109catch (Exception ex) 124private static void HandleExceptions(IEnumerable<Exception>? exceptions) 132private static void RecordException(Exception exception, EnrichmentTagCollector tags, LoggerConfig config) 147private static string GetExceptionStackTrace(Exception exception, LoggerConfig config) 165void HandleException(Exception exception, int indent) 196foreach (var ex in aggregateException.InnerExceptions) 208private void ModernPath(LogLevel logLevel, EventId eventId, LoggerMessageState msgState, Exception? exception, Func<LoggerMessageState, Exception?, string> formatter) 242List<Exception>? exceptions = null; 251catch (Exception ex) 277catch (Exception ex) 298private void LegacyPath<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 326List<Exception>? exceptions = null; 335catch (Exception ex) 357var fmt = (Func<TState, Exception?, string>)s.Formatter!; 361catch (Exception ex)
Logging\ExtendedLogger.ModernTagJoiner.cs (1)
19public Func<LoggerMessageState, Exception?, string>? Formatter;
Logging\Import\LoggerInformation.cs (2)
35public Action<LogLevel, EventId, ExtendedLogger.ModernTagJoiner, Exception?, Func<ExtendedLogger.ModernTagJoiner, Exception?, string>> LoggerLog { get; }
Logging\LoggingEventSource.cs (1)
15internal void LoggingException(Exception ex)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Telemetry.Abstractions (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Extensions.Telemetry.PerformanceTests (6)
BenchLogger.cs (2)
35public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
ClassicCodeGen.cs (2)
18private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.String, global::System.String, global::System.String, global::System.String, global::System.String, global::System.String, global::System.Exception?> __RefTypesCallback = 29private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, global::System.Int64, global::System.Int64, global::System.Int32, global::System.Guid, global::System.Exception?> __ValueTypesCallback =
ExtendedLoggerBench.cs (2)
28private static readonly Action<ILogger, string, string, string, string, string, string, Exception?> _loggerMessage_refTypes = LoggerMessage.Define<string, string, string, string, string, string>( 33private static readonly Action<ILogger, long, long, int, Guid, Exception?> _loggerMessage_valueTypes = LoggerMessage.Define<long, long, int, Guid>(
Microsoft.Extensions.Telemetry.Tests (13)
Logging\ExtendedLoggerFactoryTests.cs (5)
114.Throws<Exception>(); 554public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) 592public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Logging\ExtendedLoggerTests.cs (8)
412Exception ex; 415List<Exception> exceptions = []; 418throw new ArgumentNullException("EM1", (Exception?)null); 427throw new ArgumentOutOfRangeException("EM2", (Exception?)null); 825Exception? exception, 826Func<TState, Exception?, string> formatter) 889public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) => _provider.State = state?.ToString();
Microsoft.Extensions.TimeProvider.Testing (2)
src\Shared\Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Microsoft.Gen.Logging.Generated.Tests (10)
test\Generators\Microsoft.Gen.Logging\TestClasses\AtSymbolsTestExtensions.cs (1)
28public static partial void UseAtSymbol4(ILogger logger, LogLevel level, string @myevent3, int otherevent, System.Exception ex);
test\Generators\Microsoft.Gen.Logging\TestClasses\CollectionTestExtensions.cs (1)
40public static partial void M9(ILogger logger, LogLevel level, int p0, System.Exception ex, int p1);
test\Generators\Microsoft.Gen.Logging\TestClasses\ExceptionTestExtensions.cs (6)
12public static partial void M0(ILogger logger, Exception ex1, Exception ex2); 15public static partial void M1(Exception ex1, ILogger logger, Exception ex2); 19public static partial void M2(ILogger logger, string arg1, Exception ex); 23public static partial void M3(Exception ex, ILogger logger, LogLevel level);
Utils.cs (2)
63public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Microsoft.Gen.MetricsReports\MetricDefinitionEmitter.cs (1)
140catch (Exception e)
Microsoft.Gen.MetricsReports (1)
MetricDefinitionEmitter.cs (1)
140catch (Exception e)
Microsoft.JSInterop (11)
Infrastructure\DotNetDispatcher.cs (2)
99catch (Exception ex) 302/// <exception cref="Exception">
Infrastructure\DotNetInvocationResult.cs (4)
14/// <param name="exception">The <see cref="System.Exception"/> that caused the failure.</param> 16internal DotNetInvocationResult(Exception exception, string? errorKind) 37/// Gets the <see cref="System.Exception"/> that caused the failure. 39public Exception? Exception { get; }
Infrastructure\TaskGenericsUtil.cs (3)
20public static void SetTaskCompletionSourceException(object taskCompletionSource, Exception exception) 59void SetException(object taskCompletionSource, Exception exception); 97public void SetException(object tcs, Exception exception)
JSException.cs (1)
24public JSException(string message, Exception innerException) : base(message, innerException)
JSRuntime.cs (1)
259catch (Exception exception)
Microsoft.JSInterop.Tests (12)
Infrastructure\ByteArrayJsonConverterTest.cs (1)
64var ex = Record.Exception(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions));
Infrastructure\DotNetDispatcherTest.cs (2)
769var exception = jsRuntime.LastCompletionResult.Exception; 785var exception = jsRuntime.LastCompletionResult.Exception;
Infrastructure\DotNetObjectReferenceJsonConverterTest.cs (2)
52var ex = Record.Exception(() => JsonSerializer.Deserialize<DotNetObjectReference<TestModel>>(json, JsonSerializerOptions)); 67var ex = Record.Exception(() => JsonSerializer.Deserialize<DotNetObjectReference<TestModel>>(json, JsonSerializerOptions));
Infrastructure\JSObjectReferenceJsonConverterTest.cs (2)
49var ex = Record.Exception(() => JsonSerializer.Deserialize<IJSObjectReference>(json, JsonSerializerOptions)); 60var ex = Record.Exception(() => JsonSerializer.Deserialize<IJSObjectReference>(json, JsonSerializerOptions));
Infrastructure\JSStreamReferenceJsonConverterTest.cs (2)
49var ex = Record.Exception(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions)); 60var ex = Record.Exception(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions));
JSRuntimeTest.cs (3)
302var exception = new Exception("Some really sensitive data in here"); 430public Exception? InnerException { get; set; } 432public JSError(DotNetInvocationInfo invocationInfo, Exception? innerException)
Microsoft.JSInterop.WebAssembly (1)
WebAssemblyJSRuntime.cs (1)
32catch (Exception ex)
Microsoft.Maui (23)
Animations\Animation.cs (1)
242 catch (Exception)
Animations\LerpingAnimation.cs (1)
100 catch (Exception)
Core\IImage.cs (1)
38 void LoadingFailed(Exception exception);
Dispatching\DispatcherExtensions.cs (2)
30 catch (Exception ex) 70 catch (Exception e)
Fonts\FileSystemEmbeddedFontLoader.cs (1)
75 catch (Exception ex)
Fonts\FontRegistrar.cs (1)
69 catch (Exception ex)
Handlers\HybridWebView\HybridWebViewHandler.cs (1)
197 catch (Exception ex)
Handlers\HybridWebView\HybridWebViewInvokeJavaScriptException.cs (1)
19 public HybridWebViewInvokeJavaScriptException(string? message, Exception? innerException)
Handlers\HybridWebView\HybridWebViewTaskManager.cs (1)
37 public void SetTaskFailed(string taskId, Exception exception)
Handlers\HybridWebView\IHybridWebViewTaskManager.cs (1)
11 void SetTaskFailed(string taskId, Exception exception);
Hosting\MauiAppBuilder.cs (2)
200 public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
HotReload\HotReloadHelper.cs (2)
101 catch (Exception ex) 140 catch (Exception ex)
Platform\HandlerNotFoundException.cs (1)
24 public HandlerNotFoundException(string message, Exception innerException) : base(message, innerException)
TaskExtensions.cs (6)
13 Action<Exception>? errorCallback = null) 20 catch (Exception exc) 31 Action<Exception>? errorCallback = null 38 catch (Exception ex) 61 static void Log(ILogger? logger, Exception ex, string? callerName) => 71 catch (Exception ex)
VisualDiagnostics\BootstrapHelper.cs (1)
49 catch (Exception ex)
Microsoft.Maui.Controls (25)
BindingExpressionHelper.cs (1)
51 catch (Exception ex) when (ex is InvalidCastException || ex is FormatException || ex is InvalidOperationException || ex is OverflowException)
Interactivity\EventTrigger.cs (1)
83 catch (Exception)
Internals\ImageParser.cs (1)
26 public GIFDecoderFormatException(string message, Exception innerException) : base(message, innerException)
Internals\ResourceLoader.cs (1)
37 internal static Action<(Exception exception, string filepath)> ExceptionHandler2 { get; set; }
InvalidNavigationException.cs (1)
23 public InvalidNavigationException(string message, Exception innerException)
NavigationPage\NavigationPage.cs (1)
239 catch (Exception e)
PlatformBindingHelpers.cs (1)
169 catch (Exception)
Shell\Shell.cs (2)
1256 catch (Exception exc) 1552 catch (Exception exc)
Shell\ShellNavigatingEventArgs.cs (1)
90 catch (Exception exc)
StyleSheets\Style.cs (1)
121 var ret = value.ConvertTo(property.ReturnType, minforetriever, serviceProvider, out Exception exception);
TypedBinding.cs (1)
316 catch (Exception ex) when (ex is NullReferenceException || ex is KeyNotFoundException || ex is IndexOutOfRangeException || ex is ArgumentOutOfRangeException)
UnsolvableConstraintsException.cs (1)
22 public UnsolvableConstraintsException(string message, Exception innerException)
UriImageSource.cs (2)
73 catch (Exception ex) 123 catch (Exception ex)
Xaml\TypeConversionExtensions.cs (6)
46 IServiceProvider serviceProvider, out Exception exception) 63 IServiceProvider serviceProvider, out Exception exception) 114 Exception exception = null; 131 IServiceProvider serviceProvider, out Exception exception) 145 catch (Exception e) 157 catch (Exception e)
Xaml\ValueConverterProvider.cs (1)
15 var ret = value.ConvertTo(toType, minfoRetriever, serviceProvider, out Exception exception);
XamlParseException.cs (3)
25 public XamlParseException(string message, Exception innerException) 39 internal XamlParseException(string message, IServiceProvider serviceProvider, Exception innerException = null) 45 public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null)
Microsoft.Maui.Controls.Build.Tasks (12)
BuildException.cs (1)
18 public BuildException(BuildExceptionCode code, IXmlLineInfo xmlInfo, Exception innerException, params object[] args)
DebugXamlCTask.cs (1)
16 public override bool Execute(out IList<Exception> thrownExceptions)
XamlCTask.cs (8)
156 public override bool Execute(out IList<Exception> thrownExceptions) 307 Exception e; 312 (thrownExceptions = thrownExceptions ?? new List<Exception>()).Add(e); 332 (thrownExceptions = thrownExceptions ?? new List<Exception>()).Add(error); 402 catch (Exception e) 406 (thrownExceptions = thrownExceptions ?? new List<Exception>()).Add(e); 415 bool TryCoreCompile(MethodDefinition initComp, ILRootNode rootnode, string xamlFilePath, TaskLoggingHelper loggingHelper, out Exception exception) 452 catch (Exception e)
XamlTask.cs (2)
37 IList<Exception> _; 41 public abstract bool Execute(out IList<Exception> thrownExceptions);
Microsoft.Maui.Controls.Compatibility (1)
src\Core\src\VisualDiagnostics\BootstrapHelper.cs (1)
49 catch (Exception ex)
Microsoft.Maui.Controls.Foldable (1)
TwoPaneView.cs (1)
263 catch (Exception)
Microsoft.Maui.Controls.SourceGen (5)
CodeBehindGenerator.cs (2)
744 public XamlProjectItem(ProjectItem projectItem, Exception exception) 753 public Exception? Exception { get; }
src\Controls\src\Core\XamlParseException.cs (3)
25 public XamlParseException(string message, Exception innerException) 39 internal XamlParseException(string message, IServiceProvider serviceProvider, Exception innerException = null) 45 public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null)
Microsoft.Maui.Controls.Xaml (36)
ApplyPropertiesVisitor.cs (20)
134 Exception xpe = null; 176 catch (Exception e) 198 Exception xpe = null; 279 catch (Exception e) 358 if (TrySetPropertyValue(xamlelement, propertyName, xKey, value, rootElement, lineInfo, serviceProvider, out var xpe)) 368 public static bool TrySetPropertyValue(object element, XmlName propertyName, string xKey, object value, object rootElement, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, out Exception xpe) 431 public static object GetPropertyValue(object xamlElement, XmlName propertyName, object rootElement, IXmlLineInfo lineInfo, out Exception xpe, out object targetProperty) 455 static bool TryConnectEvent(object element, string localName, bool attached, object value, object rootElement, IXmlLineInfo lineInfo, out Exception exception) 521 static bool TrySetDynamicResource(object element, BindableProperty property, object value, IXmlLineInfo lineInfo, out Exception exception) 542 static bool TrySetBinding(object element, BindableProperty property, string localName, object value, IXmlLineInfo lineInfo, out BindingBase binding, out Exception exception) 574 static bool TrySetValue(object element, BindableProperty property, bool attached, object value, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, out Exception exception) 619 catch (Exception e) 637 static bool TryGetValue(object element, BindableProperty property, bool attached, out object value, IXmlLineInfo lineInfo, out Exception exception, out object targetProperty) 655 static bool TrySetProperty(object element, string localName, object value, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, object rootElement, out Exception exception) 680 catch (Exception e) 687 static bool TryGetProperty(object element, string localName, out object value, IXmlLineInfo lineInfo, object rootElement, out Exception exception, out object targetProperty) 732 static bool TryAddToProperty(object element, XmlName propertyName, object value, string xKey, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, object rootElement, out Exception exception) 755 catch (Exception e) 762 static bool TryAddToResourceDictionary(ResourceDictionary resourceDictionary, object value, string xKey, IXmlLineInfo lineInfo, out Exception exception) 802 static bool TryAddValue(BindableObject bindable, BindableProperty property, object value, IServiceProvider serviceProvider, out Exception exception)
CreateValuesVisitor.cs (3)
99 serviceProvider, out Exception exception); 141 catch (Exception e) 324 var convertedValue = value.ConvertTo(parameter.ParameterType, () => parameter, serviceProvider, out Exception e);
ExpandMarkupsVisitor.cs (1)
118 internal Action<Exception> ExceptionHandler { get; set; }
HydrationContext.cs (1)
18 public Action<Exception> ExceptionHandler { get; set; }
MarkupExtensionParser.cs (1)
100 (Func<TypeConverter>)null, serviceProvider, out Exception converterException);
MarkupExtensions\AppThemeBindingExtension.cs (1)
115 Exception converterException = null;
MarkupExtensions\OnIdiomExtension.cs (1)
103 var ret = value.ConvertTo(propertyType, () => pi, serviceProvider, out Exception exception);
MarkupExtensions\OnPlatformExtension.cs (1)
122 var ret = value.ConvertTo(propertyType, () => pi, serviceProvider, out Exception exception);
XamlLoader.cs (6)
81 void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, XamlFilePathAttribute.GetFilePathForObject(view))); 86 ExceptionHandler = doNotThrow ? ehandler : (Action<Exception>)null 101 void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, null)); 126 ExceptionHandler = doNotThrow ? ehandler : (Action<Exception>)null, 143 void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, XamlFilePathAttribute.GetFilePathForObject(rootView))); 170 ExceptionHandler = ResourceLoader.ExceptionHandler2 != null ? ehandler : (Action<Exception>)null,
XamlParser.cs (1)
351 catch (Exception ex)
Microsoft.Maui.Essentials (6)
MainThread\MainThread.shared.cs (4)
56 catch (Exception ex) 87 catch (Exception ex) 118 catch (Exception e) 150 catch (Exception e)
Types\Shared\Exceptions.shared.cs (2)
72 public FeatureNotSupportedException(string message, Exception innerException) 104 public FeatureNotEnabledException(string message, Exception innerException)
Microsoft.Maui.Graphics (4)
Insets.cs (1)
103 catch (Exception exc)
InsetsF.cs (1)
103 catch (Exception exc)
PathBuilder.cs (2)
53 catch (Exception exc) 207 catch (Exception exc)
Microsoft.Maui.Graphics.Skia (4)
SkiaCanvas.cs (4)
270 catch (Exception exc) 307 catch (Exception exc) 332 catch (Exception exc) 364 catch (Exception exc)
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\SimpleCssParser.cs (1)
28 catch (Exception exc)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
src\Graphics\src\Graphics\Platforms\Windows\GraphicsExtensions.cs (1)
251 catch (Exception exc)
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvas.cs (1)
298 catch (Exception exc)
Microsoft.Maui.Maps (6)
src\Core\src\TaskExtensions.cs (6)
13 Action<Exception>? errorCallback = null) 20 catch (Exception exc) 31 Action<Exception>? errorCallback = null 38 catch (Exception ex) 61 static void Log(ILogger? logger, Exception ex, string? callerName) => 71 catch (Exception ex)
Microsoft.Maui.Resizetizer (11)
AsyncTask.cs (1)
68 var ex = task.Exception.GetBaseException();
AsyncTaskExtensions.cs (1)
23 catch (Exception exc)
CreatePartialInfoPlistTask.cs (1)
64 catch (Exception ex)
DetectInvalidResourceOutputFilenamesTask.cs (1)
39 catch (Exception ex)
GeneratePackageAppxManifest.cs (1)
61 catch (Exception ex)
GenerateSplashAndroidResources.cs (1)
53 catch (Exception ex)
GenerateSplashStoryboard.cs (1)
49 catch (Exception ex)
GenerateTizenManifest.cs (1)
73 catch (Exception ex)
MauiAsyncTask.cs (1)
25 catch (Exception exc)
ResizetizeImages.cs (1)
89 catch (Exception ex)
SkiaSharpTools.cs (1)
208 catch (Exception ex)
Microsoft.ML.AutoML (33)
API\BinaryClassificationExperiment.cs (2)
460catch (Exception ex) when (ct.IsCancellationRequested) 464catch (Exception)
API\InferenceException.cs (1)
40internal InferenceException(InferenceExceptionType inferenceType, string message, Exception inner)
API\MulticlassClassificationExperiment.cs (2)
438catch (Exception ex) when (ct.IsCancellationRequested) 442catch (Exception)
API\RegressionExperiment.cs (2)
453catch (Exception ex) when (ct.IsCancellationRequested) 457catch (Exception)
API\RunDetails\CrossValidationRunDetail.cs (2)
64public Exception Exception { get; private set; } 70Exception exception)
API\RunDetails\RunDetail.cs (2)
48public Exception Exception { get; private set; } 57Exception exception) : base(trainerName, estimator, pipeline)
AutoMLExperiment\AutoMLExperiment.cs (2)
296catch (Exception ex) when (aggregateTrainingStopManager.IsStopTrainingRequested() == false) 330catch (Exception) when (aggregateTrainingStopManager.IsStopTrainingRequested())
AutoMLExperiment\IMonitor.cs (3)
20void ReportFailTrial(TrialSettings settings, Exception exception = null); 59public virtual void ReportFailTrial(TrialSettings settings, Exception exception = null) 113public override void ReportFailTrial(TrialSettings settings, Exception exp)
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (2)
106catch (Exception ex) when (ct.IsCancellationRequested) 110catch (Exception)
AutoMLExperiment\TrialResult.cs (1)
61public Exception Exception { get; set; }
ColumnInference\TextFileContents.cs (1)
123catch (Exception)
Experiment\Experiment.cs (1)
245catch (Exception ex)
Experiment\Runners\CrossValSummaryRunner.cs (2)
56var trainResults = new List<(ModelContainer model, TMetrics metrics, Exception exception, double score)>(); 70var firstException = trainResults.First(r => r.exception != null).exception;
Experiment\Runners\RunnerUtil.cs (2)
13public static (ModelContainer model, TMetrics metrics, Exception exception, double score) 47catch (Exception ex)
Experiment\SuggestedPipelineRunDetails\SuggestedPipelineCrossValRunDetail.cs (2)
15public readonly Exception Exception; 20Exception exception,
Experiment\SuggestedPipelineRunDetails\SuggestedPipelineRunDetail.cs (2)
15public Exception Exception { get; set; } 45Exception ex) : base(pipeline, score, runSucceeded)
PipelineSuggesters\PipelineSuggester.cs (1)
225catch (Exception ex)
Sweepers\SmacSweeper.cs (1)
247catch (Exception e)
TrainerExtensions\TrainerExtensionUtil.cs (1)
294catch (Exception)
Tuner\SmacTuner.cs (1)
252catch (Exception e)
Microsoft.ML.AutoML.Interactive (1)
NotebookMonitor.cs (1)
60public void ReportFailTrial(TrialSettings setting, Exception exp = null)
Microsoft.ML.AutoML.Samples (1)
Program.cs (1)
33catch (Exception ex)
Microsoft.ML.AutoML.Tests (5)
AutoFitTests.cs (4)
564foreach (var ex in ae.Flatten().InnerExceptions) 566var ignoredExceptions = new List<Exception>(); 663var lastException = experiment.RunDetails.Last().Exception; 672foreach (var ex in lastAggregateException.Flatten().InnerExceptions)
Utils\TaskAgnosticIterationResult.cs (1)
19internal readonly Exception Exception;
Microsoft.ML.CodeGenerator (2)
CodeGenerator\CSharp\PipelineExtension.cs (1)
82catch (Exception)
Utils.cs (1)
46catch (Exception)
Microsoft.ML.Core (131)
CommandLine\CmdParser.cs (2)
985catch (Exception e) 1056catch (Exception e)
ComponentModel\AssemblyLoadingUtils.cs (6)
29Exception ex = null; 42catch (Exception e) 53catch (Exception e) 66catch (Exception e) 75catch (Exception e) 216catch (Exception)
ComponentModel\ComponentCatalog.cs (1)
1065catch (Exception e)
Data\AnnotationUtils.cs (2)
118public static Exception ExceptGetAnnotation() => Contracts.Except("Invalid call to GetAnnotation"); 123public static Exception ExceptGetAnnotation(this IExceptionContext ctx) => ctx.Except("Invalid call to GetAnnotation");
Data\ModelHeader.cs (6)
206Exception ex; 329Exception ex; 386public static bool TryValidate(ref ModelHeader header, long size, out Exception ex) 456catch (Exception e) 466public static bool TryValidate(ref ModelHeader header, BinaryReader reader, long fpMin, out string[] strings, out string loaderAssemblyName, out Exception ex) 561catch (Exception e)
Data\Repository.cs (1)
464catch (Exception ex)
Environment\HostEnvironmentBase.cs (1)
66where TException : Exception
Environment\TelemetryMessage.cs (3)
33public static TelemetryMessage CreateException(Exception exception) 63public readonly Exception Exception; 64public TelemetryException(Exception exception)
Utilities\Contracts.cs (98)
39where TException : Exception; 89where TException : Exception 99/// <see cref="Exception.Data"/> to 1. 102where TException : Exception 112public static bool IsMarked(this Exception ex) 125where TException : Exception 147public static MessageSensitivity Sensitivity(this Exception ex) 189public TException Process<TException>(TException ex) where TException : Exception 255public static Exception Except() 257public static Exception Except(this IExceptionContext ctx) 259public static Exception Except(string msg) 261public static Exception Except(this IExceptionContext ctx, string msg) 263public static Exception Except(string msg, params object[] args) 265public static Exception Except(this IExceptionContext ctx, string msg, params object[] args) 267public static Exception Except(Exception inner, string msg) 269public static Exception Except(this IExceptionContext ctx, Exception inner, string msg) 271public static Exception Except(Exception inner, string msg, params object[] args) 273public static Exception Except(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 281public static Exception ExceptUserArg(string name) 283public static Exception ExceptUserArg(this IExceptionContext ctx, string name) 285public static Exception ExceptUserArg(string name, string msg) 287public static Exception ExceptUserArg(this IExceptionContext ctx, string name, string msg) 289public static Exception ExceptUserArg(string name, string msg, params object[] args) 291public static Exception ExceptUserArg(this IExceptionContext ctx, string name, string msg, params object[] args) 297public static Exception ExceptParam(string paramName) 299public static Exception ExceptParam(this IExceptionContext ctx, string paramName) 301public static Exception ExceptParam(string paramName, string msg) 303public static Exception ExceptParam(this IExceptionContext ctx, string paramName, string msg) 305public static Exception ExceptParam(string paramName, string msg, params object[] args) 307public static Exception ExceptParam(this IExceptionContext ctx, string paramName, string msg, params object[] args) 309public static Exception ExceptParamValue<T>(T value, string paramName, string msg) 311public static Exception ExceptParamValue<T>(this IExceptionContext ctx, T value, string paramName, string msg) 313public static Exception ExceptParamValue<T>(T value, string paramName, string msg, params object[] args) 315public static Exception ExceptParamValue<T>(this IExceptionContext ctx, T value, string paramName, string msg, params object[] args) 321public static Exception ExceptValue(string paramName) 323public static Exception ExceptValue(this IExceptionContext ctx, string paramName) 325public static Exception ExceptValue(string paramName, string msg) 327public static Exception ExceptValue(this IExceptionContext ctx, string paramName, string msg) 329public static Exception ExceptValue(string paramName, string msg, params object[] args) 331public static Exception ExceptValue(this IExceptionContext ctx, string paramName, string msg, params object[] args) 339public static Exception ExceptEmpty(string paramName) 341public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName) 343public static Exception ExceptEmpty(string paramName, string msg) 345public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName, string msg) 347public static Exception ExceptEmpty(string paramName, string msg, params object[] args) 349public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName, string msg, params object[] args) 355public static Exception ExceptWhiteSpace(string paramName) 357public static Exception ExceptWhiteSpace(this IExceptionContext ctx, string paramName) 359public static Exception ExceptWhiteSpace(string paramName, string msg) 361public static Exception ExceptWhiteSpace(this IExceptionContext ctx, string paramName, string msg) 369public static Exception ExceptDecode() 371public static Exception ExceptDecode(this IExceptionContext ctx) 373public static Exception ExceptDecode(string msg) 375public static Exception ExceptDecode(this IExceptionContext ctx, string msg) 377public static Exception ExceptDecode(string msg, params object[] args) 379public static Exception ExceptDecode(this IExceptionContext ctx, string msg, params object[] args) 381public static Exception ExceptDecode(Exception inner, string msg) 383public static Exception ExceptDecode(this IExceptionContext ctx, Exception inner, string msg) 385public static Exception ExceptDecode(Exception inner, string msg, params object[] args) 387public static Exception ExceptDecode(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 393public static Exception ExceptIO() 395public static Exception ExceptIO(this IExceptionContext ctx) 397public static Exception ExceptIO(string msg) 399public static Exception ExceptIO(this IExceptionContext ctx, string msg) 401public static Exception ExceptIO(string msg, params object[] args) 403public static Exception ExceptIO(this IExceptionContext ctx, string msg, params object[] args) 405public static Exception ExceptIO(Exception inner, string msg) 407public static Exception ExceptIO(this IExceptionContext ctx, Exception inner, string msg) 409public static Exception ExceptIO(Exception inner, string msg, params object[] args) 411public static Exception ExceptIO(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 417public static Exception ExceptNotImpl() 419public static Exception ExceptNotImpl(this IExceptionContext ctx) 421public static Exception ExceptNotImpl(string msg) 423public static Exception ExceptNotImpl(this IExceptionContext ctx, string msg) 425public static Exception ExceptNotImpl(string msg, params object[] args) 427public static Exception ExceptNotImpl(this IExceptionContext ctx, string msg, params object[] args) 433public static Exception ExceptNotSupp() 435public static Exception ExceptNotSupp(this IExceptionContext ctx) 437public static Exception ExceptNotSupp(string msg) 439public static Exception ExceptNotSupp(this IExceptionContext ctx, string msg) 441public static Exception ExceptNotSupp(string msg, params object[] args) 443public static Exception ExceptNotSupp(this IExceptionContext ctx, string msg, params object[] args) 449public static Exception ExceptSchemaMismatch(string paramName, string columnRole, string columnName) 451public static Exception ExceptSchemaMismatch(this IExceptionContext ctx, string paramName, string columnRole, string columnName) 453public static Exception ExceptSchemaMismatch(string paramName, string columnRole, string columnName, string expectedType, string actualType) 455public static Exception ExceptSchemaMismatch(this IExceptionContext ctx, string paramName, string columnRole, string columnName, string expectedType, string actualType)
Utilities\OrderedWaiter.cs (2)
45private Exception _ex; 136public void SignalException(Exception ex)
Utilities\PathUtils.cs (1)
141catch (Exception exc)
Utilities\ResourceManagerUtils.cs (6)
143catch (Exception ex) 163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default); 183catch (Exception e) 221catch (Exception e) 240catch (Exception e) 249private async Task<Exception> DownloadResource(IHostEnvironment env, IChannel ch, HttpClient httpClient, Uri uri, string path, string fileName, CancellationToken ct)
Utilities\ThreadUtils.cs (2)
184private Exception _ex; 214public void Set(string component, Exception ex)
Microsoft.ML.Core.Tests (13)
UnitTests\DataTypes.cs (11)
95var ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 101ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 135var ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 141ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 175var ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 181ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst)); 221var ex = Assert.ThrowsAny<Exception>(() => mapper(in src, ref dst));
UnitTests\TestContracts.cs (2)
28catch (Exception e) 40catch (Exception e)
Microsoft.ML.CpuMath (97)
src\Microsoft.ML.Core\Utilities\Contracts.cs (97)
39where TException : Exception; 89where TException : Exception 99/// <see cref="Exception.Data"/> to 1. 102where TException : Exception 112public static bool IsMarked(this Exception ex) 125where TException : Exception 147public static MessageSensitivity Sensitivity(this Exception ex) 255public static Exception Except() 257public static Exception Except(this IExceptionContext ctx) 259public static Exception Except(string msg) 261public static Exception Except(this IExceptionContext ctx, string msg) 263public static Exception Except(string msg, params object[] args) 265public static Exception Except(this IExceptionContext ctx, string msg, params object[] args) 267public static Exception Except(Exception inner, string msg) 269public static Exception Except(this IExceptionContext ctx, Exception inner, string msg) 271public static Exception Except(Exception inner, string msg, params object[] args) 273public static Exception Except(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 281public static Exception ExceptUserArg(string name) 283public static Exception ExceptUserArg(this IExceptionContext ctx, string name) 285public static Exception ExceptUserArg(string name, string msg) 287public static Exception ExceptUserArg(this IExceptionContext ctx, string name, string msg) 289public static Exception ExceptUserArg(string name, string msg, params object[] args) 291public static Exception ExceptUserArg(this IExceptionContext ctx, string name, string msg, params object[] args) 297public static Exception ExceptParam(string paramName) 299public static Exception ExceptParam(this IExceptionContext ctx, string paramName) 301public static Exception ExceptParam(string paramName, string msg) 303public static Exception ExceptParam(this IExceptionContext ctx, string paramName, string msg) 305public static Exception ExceptParam(string paramName, string msg, params object[] args) 307public static Exception ExceptParam(this IExceptionContext ctx, string paramName, string msg, params object[] args) 309public static Exception ExceptParamValue<T>(T value, string paramName, string msg) 311public static Exception ExceptParamValue<T>(this IExceptionContext ctx, T value, string paramName, string msg) 313public static Exception ExceptParamValue<T>(T value, string paramName, string msg, params object[] args) 315public static Exception ExceptParamValue<T>(this IExceptionContext ctx, T value, string paramName, string msg, params object[] args) 321public static Exception ExceptValue(string paramName) 323public static Exception ExceptValue(this IExceptionContext ctx, string paramName) 325public static Exception ExceptValue(string paramName, string msg) 327public static Exception ExceptValue(this IExceptionContext ctx, string paramName, string msg) 329public static Exception ExceptValue(string paramName, string msg, params object[] args) 331public static Exception ExceptValue(this IExceptionContext ctx, string paramName, string msg, params object[] args) 339public static Exception ExceptEmpty(string paramName) 341public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName) 343public static Exception ExceptEmpty(string paramName, string msg) 345public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName, string msg) 347public static Exception ExceptEmpty(string paramName, string msg, params object[] args) 349public static Exception ExceptEmpty(this IExceptionContext ctx, string paramName, string msg, params object[] args) 355public static Exception ExceptWhiteSpace(string paramName) 357public static Exception ExceptWhiteSpace(this IExceptionContext ctx, string paramName) 359public static Exception ExceptWhiteSpace(string paramName, string msg) 361public static Exception ExceptWhiteSpace(this IExceptionContext ctx, string paramName, string msg) 369public static Exception ExceptDecode() 371public static Exception ExceptDecode(this IExceptionContext ctx) 373public static Exception ExceptDecode(string msg) 375public static Exception ExceptDecode(this IExceptionContext ctx, string msg) 377public static Exception ExceptDecode(string msg, params object[] args) 379public static Exception ExceptDecode(this IExceptionContext ctx, string msg, params object[] args) 381public static Exception ExceptDecode(Exception inner, string msg) 383public static Exception ExceptDecode(this IExceptionContext ctx, Exception inner, string msg) 385public static Exception ExceptDecode(Exception inner, string msg, params object[] args) 387public static Exception ExceptDecode(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 393public static Exception ExceptIO() 395public static Exception ExceptIO(this IExceptionContext ctx) 397public static Exception ExceptIO(string msg) 399public static Exception ExceptIO(this IExceptionContext ctx, string msg) 401public static Exception ExceptIO(string msg, params object[] args) 403public static Exception ExceptIO(this IExceptionContext ctx, string msg, params object[] args) 405public static Exception ExceptIO(Exception inner, string msg) 407public static Exception ExceptIO(this IExceptionContext ctx, Exception inner, string msg) 409public static Exception ExceptIO(Exception inner, string msg, params object[] args) 411public static Exception ExceptIO(this IExceptionContext ctx, Exception inner, string msg, params object[] args) 417public static Exception ExceptNotImpl() 419public static Exception ExceptNotImpl(this IExceptionContext ctx) 421public static Exception ExceptNotImpl(string msg) 423public static Exception ExceptNotImpl(this IExceptionContext ctx, string msg) 425public static Exception ExceptNotImpl(string msg, params object[] args) 427public static Exception ExceptNotImpl(this IExceptionContext ctx, string msg, params object[] args) 433public static Exception ExceptNotSupp() 435public static Exception ExceptNotSupp(this IExceptionContext ctx) 437public static Exception ExceptNotSupp(string msg) 439public static Exception ExceptNotSupp(this IExceptionContext ctx, string msg) 441public static Exception ExceptNotSupp(string msg, params object[] args) 443public static Exception ExceptNotSupp(this IExceptionContext ctx, string msg, params object[] args) 449public static Exception ExceptSchemaMismatch(string paramName, string columnRole, string columnName) 451public static Exception ExceptSchemaMismatch(this IExceptionContext ctx, string paramName, string columnRole, string columnName) 453public static Exception ExceptSchemaMismatch(string paramName, string columnRole, string columnName, string expectedType, string actualType) 455public static Exception ExceptSchemaMismatch(this IExceptionContext ctx, string paramName, string columnRole, string columnName, string expectedType, string actualType)
Microsoft.ML.Data (28)
Data\DataViewUtils.cs (4)
443catch (Exception ex) 592catch (Exception ex) 789private readonly Exception _ex; 815public Batch(Exception ex)
DataLoadSave\Binary\BinaryLoader.cs (2)
1405catch (Exception ex) 1434catch (Exception ex)
DataLoadSave\Binary\BinarySaver.cs (4)
153/// also have a dual usage if <see cref="Exception"/> is non-null of indicating 243catch (Exception ex) 564catch (Exception ex) 631catch (Exception ex)
DataLoadSave\MultiFileSource.cs (1)
85catch (Exception e)
DataLoadSave\Text\TextLoaderCursor.cs (5)
365public readonly Exception Exception; 378public LineBatch(Exception ex) 788catch (Exception ex) 890public volatile Exception ParsingException; 957catch (Exception ex)
DataLoadSave\Transpose\TransposeLoader.cs (1)
655catch (Exception)
DataView\CacheDataView.cs (1)
433catch (Exception ex)
Dirty\PredictionUtils.cs (1)
41catch (Exception e)
Model\ModelOperationsCatalog.cs (2)
186catch (Exception ex) 269catch (Exception ex)
Scorers\RowToRowScorerBase.cs (1)
256catch (Exception)
Transforms\ColumnSelecting.cs (1)
255catch (Exception)
Transforms\RowShufflingTransformer.cs (2)
493private Exception _producerTaskException; 608catch (Exception ex)
Transforms\TransformBase.cs (1)
771protected Exception ExceptGetSlotCursor(int col)
Transforms\ValueMapping.cs (2)
658catch (Exception ex) 703catch (Exception)
Microsoft.ML.DataView (5)
Contracts.cs (5)
32public static Exception Except(string msg) 35public static Exception ExceptParam(string paramName) 37public static Exception ExceptParam(string paramName, string msg) 39public static Exception ExceptParam(string paramName, string msg, params object[] args) 42public static Exception ExceptValue(string paramName)
Microsoft.ML.Ensemble (1)
Trainer\EnsembleTrainerBase.cs (1)
166catch (Exception ex)
Microsoft.ML.FastTree (1)
FastTreeRanking.cs (1)
162catch (Exception ex)
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
486catch (Exception)
Microsoft.ML.Maml (12)
MAML.cs (12)
134catch (Exception ex) 156catch (Exception) 163for (var e = ex; e != null; e = e.InnerException) 225catch (Exception ex) 235/// <see cref="Exception.InnerException"/> chain. 237private static void PrintFullExceptionDetails(TextWriter writer, Exception ex) 245for (var e = ex; e != null; e = e.InnerException) 256/// <see cref="Exception.InnerException"/> chain. 258private static void PrintFullExceptionDetails(IChannel ch, Exception ex) 263for (var e = ex; e != null; e = e.InnerException) 273private static void PrintExceptionData(TextWriter writer, Exception ex, bool includeComponents) 312private static void PrintExceptionData(IChannel ch, Exception ex, bool includeComponents)
Microsoft.ML.Parquet (4)
ParquetLoader.cs (3)
165catch (Exception ex) 225catch (Exception ex) 735catch (Exception ex)
PartitionedFileLoader.cs (1)
476catch (Exception e)
Microsoft.ML.Predictor.Tests (2)
CmdLine\CmdIndenterTest.cs (1)
86catch (Exception ex)
CmdLine\CmdLine.cs (1)
388catch (Exception ex)
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
1020catch (Exception e)
Microsoft.ML.Samples (1)
Program.cs (1)
28catch (Exception ex)
Microsoft.ML.SearchSpace (3)
Converter\OptionConverter.cs (3)
22catch (Exception) 31catch (Exception) 40catch (Exception)
Microsoft.ML.StandardTrainers (1)
Standard\LinearModelParameters.cs (1)
473catch (Exception)
Microsoft.ML.Sweeper (6)
Algorithms\SmacSweeper.cs (1)
256catch (Exception e)
ConfigRunner.cs (1)
142catch (Exception e)
Parameters.cs (3)
604catch (Exception e) 634catch (Exception e) 658catch (Exception e)
SweepCommand.cs (1)
104catch (Exception e)
Microsoft.ML.TensorFlow (7)
TensorflowTransform.cs (1)
182catch (Exception)
TensorflowUtils.cs (6)
198catch (Exception ex) 251catch (Exception ex) 313catch (Exception exc) 382catch (Exception exc) 597catch (Exception ex) 603catch (Exception statusException)
Microsoft.ML.TestFramework (3)
BaseTestBaseline.cs (2)
965Exception inner = null; 972catch (Exception e)
DataPipe\TestDataPipeBase.cs (1)
51Exception e;
Microsoft.ML.Tests (15)
ExpressionLanguageTests\ExpressionLanguageTests.cs (1)
202catch (Exception ex)
OnnxConversionTest.cs (4)
2039catch (System.Exception ex) 2052catch (System.Exception ex) 2063catch (System.Exception ex) 2074catch (System.Exception ex)
OnnxSequenceTypeWithAttributesTest.cs (1)
107catch (System.Exception ex)
Scenarios\GetColumnTests.cs (1)
106Exception e;
TextLoaderTests.cs (4)
106catch (Exception ex) 130catch (Exception ex) 1201catch (Exception ex) 1212catch (Exception ex)
Transformers\ConcatTests.cs (1)
30catch (Exception ex)
Transformers\CustomMappingTests.cs (2)
112catch (Exception) { } 120catch (Exception) { }
Transformers\KeyToVectorEstimatorTests.cs (1)
266catch (System.Exception ex)
Microsoft.ML.Tokenizers (5)
Model\CodeGenTokenizer.cs (2)
1772catch (Exception e) 1811catch (Exception e)
Model\EnglishRobertaTokenizer.cs (2)
186catch (Exception e) 225catch (Exception e)
Model\TiktokenTokenizer.cs (1)
231catch (Exception ex)
Microsoft.ML.Tokenizers.Data.Tests (9)
src\Common\tests\RetryHelper.cs (8)
16private static readonly Predicate<Exception> _defaultRetryWhenFunc = p => true; 24public static void Execute(Action test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 39var exceptions = new List<Exception>(); 42Exception lastException; 48catch (Exception e) when (retryWhen(e)) 74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 89var exceptions = new List<Exception>(); 97catch (Exception e) when (retryWhen(e))
TokenizerDataTests.cs (1)
30var exception = Record.Exception(() => TiktokenTokenizer.CreateForModel(modelName));
Microsoft.ML.Tokenizers.Tests (8)
src\Common\tests\RetryHelper.cs (8)
16private static readonly Predicate<Exception> _defaultRetryWhenFunc = p => true; 24public static void Execute(Action test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 39var exceptions = new List<Exception>(); 42Exception lastException; 48catch (Exception e) when (retryWhen(e)) 74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 89var exceptions = new List<Exception>(); 97catch (Exception e) when (retryWhen(e))
Microsoft.ML.Transforms (1)
GroupTransform.cs (1)
341private int[] GetColumnIds(DataViewSchema schema, string[] names, Func<string, Exception> except)
Microsoft.ML.Vision (3)
DnnRetrainTransform.cs (2)
148catch (Exception) 457catch (Exception e)
ImageClassificationTrainer.cs (1)
1156catch (Exception)
Microsoft.Svcutil.NamedPipeMetadataImporter (3)
NamedPipeMetadataImporter.cs (3)
50catch (Exception ex) 61catch (Exception ex) 96catch (Exception ex)
Microsoft.VisualBasic.Core (126)
Microsoft\VisualBasic\Collection.vb (1)
104Catch ex As Exception
Microsoft\VisualBasic\CompilerServices\Conversions.vb (3)
1517Catch Ex As Exception 1923Catch Ex As Exception 1959Catch Ex As Exception
Microsoft\VisualBasic\CompilerServices\DecimalType.vb (1)
140Catch Ex As Exception
Microsoft\VisualBasic\CompilerServices\DoubleType.vb (2)
180Catch Ex As Exception 221Catch Ex As Exception
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (1)
194Friend Shared Function VbMakeException(ByVal ex As Exception, ByVal hr As Integer) As System.Exception
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (11)
133Catch ex As Exception When IsMissingMemberException(ex) 167Catch exInner As Exception When IsMissingMemberException(exInner) AndAlso (TypeOf ex Is MissingMemberException) 182Private Shared Function IsMissingMemberException(ByVal ex As Exception) As Boolean 415Catch ex As Exception When IsMissingMemberException(ex) 436Catch exInner As Exception When IsMissingMemberException(exInner) AndAlso (TypeOf ex Is MissingMemberException) 445Catch exInner As Exception 454Catch exInner As Exception When IsMissingMemberException(exInner) AndAlso (TypeOf ex Is MissingMemberException) 596Catch ex As Exception 647Catch ex As Exception When IsMissingMemberException(ex) 893Catch ex As Exception When IsMissingMemberException(ex) 1043Catch ex As Exception When IsMissingMemberException(ex)
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (1)
1254Friend Shared Function ReportPropertyMismatch(ByVal targetProcedure As Method, ByVal flags As BindingFlags) As Exception
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (2)
3577Private Shared Function GetNoValidOperatorException(ByVal Operand As Object) As Exception 3581Private Shared Function GetNoValidOperatorException(ByVal Left As Object, ByVal Right As Object) As Exception
Microsoft\VisualBasic\CompilerServices\Operators.vb (2)
86Private Shared Function GetNoValidOperatorException(ByVal op As UserDefinedOperator, ByVal operand As Object) As Exception 90Private Shared Function GetNoValidOperatorException(ByVal op As UserDefinedOperator, ByVal left As Object, ByVal right As Object) As Exception
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (4)
2521ByVal candidateFilter As CandidateProperty) As Exception 2609ByVal failure As ResolutionFailure) As Exception 2651ByVal failure As ResolutionFailure) As Exception 2683ByVal failure As ResolutionFailure) As Exception
Microsoft\VisualBasic\CompilerServices\ProjectData.vb (3)
130Public Shared Function CreateProjectError(ByVal hr As Integer) As System.Exception 151Public Overloads Shared Sub SetProjectError(ByVal ex As Exception) 172Public Overloads Shared Sub SetProjectError(ByVal ex As Exception, ByVal lErl As Integer)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
115Catch ex As Exception
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (2)
48Catch ex As Exception 118Catch e As Exception
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (1)
52Catch ex As Exception
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (3)
495Dim ex As Exception 1764Catch ex As Exception 1875Private Function CreateParamOrder(ByVal SetProp As Boolean, ByVal paramOrder() As Integer, ByVal pars() As ParameterInfo, ByVal args() As Object, ByVal names() As String) As Exception
Microsoft\VisualBasic\ErrObject.vb (7)
15Private m_curException As Exception 240Public Function GetException() As Exception 316Dim e As Exception 346Dim e As Exception = MapNumberToException(m_curNumber, Description) 351Friend Overloads Sub CaptureException(ByVal ex As Exception) 363Friend Overloads Sub CaptureException(ByVal ex As Exception, ByVal lErl As Integer) 368Private Function MapExceptionToNumber(ByVal e As Exception) As Integer
Microsoft\VisualBasic\FileIO\FileSystem.vb (5)
1022Catch ex As Exception 1043Catch ex As Exception 1063Catch ex As Exception 1327Catch ex As Exception 1506Catch ex As Exception
Microsoft\VisualBasic\FileIO\MalformedLineException.vb (2)
55Public Sub New(ByVal message As String, ByVal lineNumber As Long, ByVal innerException As Exception) 66Public Sub New(ByVal message As String, ByVal innerException As Exception)
Microsoft\VisualBasic\FileSystem.vb (50)
230Catch e2 As Exception 294Catch ex As Exception 421Catch ex As Exception 539Catch ex As Exception 562Catch ex As Exception 579Catch ex As Exception 590Catch ex As Exception 602Catch ex As Exception 612Catch ex As Exception 622Catch ex As Exception 632Catch ex As Exception 642Catch ex As Exception 652Catch ex As Exception 662Catch ex As Exception 672Catch ex As Exception 682Catch ex As Exception 692Catch ex As Exception 702Catch ex As Exception 712Catch ex As Exception 723Catch ex As Exception 739Catch ex As Exception 752Catch ex As Exception 762Catch ex As Exception 772Catch ex As Exception 782Catch ex As Exception 792Catch ex As Exception 802Catch ex As Exception 812Catch ex As Exception 822Catch ex As Exception 832Catch ex As Exception 842Catch ex As Exception 852Catch ex As Exception 862Catch ex As Exception 871Catch ex As Exception 880Catch ex As Exception 890Catch ex As Exception 899Catch ex As Exception 908Catch ex As Exception 917Catch ex As Exception 926Catch ex As Exception 935Catch ex As Exception 944Catch ex As Exception 953Catch ex As Exception 962Catch ex As Exception 971Catch ex As Exception 980Catch ex As Exception 989Catch ex As Exception 998Catch ex As Exception 1007Catch ex As Exception 1033Catch ex As Exception
Microsoft\VisualBasic\Information.vb (1)
119Return (TypeOf Expression Is Exception)
Microsoft\VisualBasic\Interaction.vb (4)
342Catch ex As Exception 402Catch ex As Exception 470Catch ex As Exception 539Catch e As Exception
Microsoft\VisualBasic\Strings.vb (19)
206Catch ex As Exception 279Catch ex As Exception 370Catch ex As Exception 472Catch ex As Exception 509Catch ex As Exception 521Catch ex As Exception 529Catch ex As Exception 696Catch ex As Exception 806Catch ex As Exception 1045Catch ex As Exception 1053Catch ex As Exception 1335Catch ex As Exception 1387Catch ex As Exception 1423Catch ex As Exception 1459Catch ex As Exception 1875Catch ex As Exception 1942Catch ex As Exception 1964Catch ex As Exception 1981Catch ex As Exception
Microsoft.VisualBasic.Tests (3)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
65catch (Exception)
Microsoft\VisualBasic\ApplicationServices\UnhandledExceptionEventArgsTests.cs (1)
16public void Ctor_Bool_Exception(bool exitApplication, Exception exception)
Microsoft\VisualBasic\MyServices\SpecialDirectoriesProxyTests.cs (1)
32catch (Exception)
Microsoft.VisualStudio.IntegrationTest.Setup (6)
TestExtensionErrorHandler.cs (1)
24public void HandleError(object sender, Exception exception)
TestExtensionManager.cs (1)
24protected override void HandleNonCancellationException(object provider, Exception exception)
TestTraceListener.cs (4)
15private ImmutableList<Exception> _failures = []; 101var reportedException = new Exception(message); 107catch (Exception ex) 123public void AddException(Exception exception)
Microsoft.VisualStudio.LanguageServices (79)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
74catch (Exception e) when (FatalError.ReportAndCatch(e))
CodeMarkers\ManagedCodeMarkers.cs (1)
143catch (Exception)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.Loader.cs (1)
37catch (Exception)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.WorkspaceEventListener.cs (1)
62catch (Exception e) when (FatalError.ReportAndPropagate(e, ErrorSeverity.Diagnostic))
EditorConfigSettings\Common\SettingsEntriesSnapshotBase.cs (1)
44catch (Exception)
ErrorReporting\DetailedErrorInfoDialog.xaml.cs (1)
32catch (Exception)
ErrorReporting\VisualStudioErrorReportingService.cs (3)
46public void ShowGlobalErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception, params InfoBarUI[] items) 59public void ShowDetailedErrorInfo(Exception exception) 65public void ShowFeatureNotAvailableErrorInfo(string message, TelemetryFeatureName featureName, Exception? exception)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (5)
20private static string GetFormattedExceptionStack(Exception exception) 35private static string GetStackForAggregateException(Exception exception, AggregateException aggregate) 46private static string GetStackForException(Exception exception, bool includeMessageOnly) 53var innerException = exception.InnerException; 74private static string GetAsyncStackTrace(Exception exception)
ExternalAccess\LegacyCodeAnalysis\LegacyCodeAnalysisVisualStudioSuppressionFixServiceAccessor.cs (3)
43catch (Exception ex) 65catch (Exception ex) 87catch (Exception ex)
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (2)
372catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken)) 512catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, cancellationToken))
GenerateType\GenerateTypeDialogViewModel.cs (1)
294catch (Exception e)
Implementation\AbstractVsTextViewFilter.cs (1)
52catch (Exception e) when (FatalError.ReportAndCatch(e) && false)
Interactive\VsInteractiveWindowPackage.cs (4)
57Action<Exception> fatalHandler = e => FaultReporter.ReportFault(e, VisualStudio.Telemetry.FaultSeverity.Critical, forceDump: false); 58Action<Exception> nonFatalHandler = e => FaultReporter.ReportFault(e, VisualStudio.Telemetry.FaultSeverity.General, forceDump: false); 68private static void SetErrorHandlers(Assembly assembly, Action<Exception> fatalHandler, Action<Exception> nonFatalHandler)
LanguageClient\LogHubLspLogger.cs (1)
64public override void LogException(Exception exception, string? message = null, params object[] @params)
LanguageService\AbstractLanguageService`2.IVsLanguageDebugInfo.cs (7)
25catch (Exception e) when (FatalError.ReportAndPropagate(e)) 37catch (Exception e) when (FatalError.ReportAndPropagate(e)) 49catch (Exception e) when (FatalError.ReportAndPropagate(e)) 61catch (Exception e) when (FatalError.ReportAndPropagate(e)) 73catch (Exception e) when (FatalError.ReportAndPropagate(e)) 85catch (Exception e) when (FatalError.ReportAndPropagate(e)) 97catch (Exception e) when (FatalError.ReportAndPropagate(e))
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (2)
124catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Diagnostic)) 530catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Critical))
Library\ObjectBrowser\ObjectList.cs (1)
761catch (Exception ex) when (FatalError.ReportAndCatch(ex, ErrorSeverity.Critical))
Log\VisualStudioErrorLogger.cs (2)
26public void LogException(object source, Exception exception) 39private static string ToLogFormat(Exception exception)
NavigateTo\RoslynSearchItemsSource.cs (1)
58catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex))
Options\FeatureFlagPersister.cs (2)
40catch (Exception e) when (FatalError.ReportAndCatch(e)) 59catch (Exception e) when (FatalError.ReportAndCatch(e))
Options\VisualStudioOptionPersisterProvider.cs (1)
94catch (Exception e) when (FatalError.ReportAndPropagate(e))
Packaging\PackageInstallerServiceFactory.cs (4)
171catch (Exception ex) when (ex is InvalidDataException or InvalidOperationException) 348catch (Exception e) when (FatalError.ReportAndCatch(e)) 409catch (Exception e) when (FatalError.ReportAndCatch(e)) 583catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
Packaging\PackageInstallerServiceFactory_UndoRedo.cs (1)
111catch (Exception e) when (FatalError.ReportAndCatch(e))
Progression\GraphQueryManager.cs (1)
163catch (Exception ex) when (FatalError.ReportAndPropagateUnlessCanceled(ex, ErrorSeverity.Diagnostic))
ProjectSystem\FileChangeTracker.cs (4)
115catch (Exception e) when (ReportException(e)) 128catch (Exception e) when (ReportException(e)) 142private static bool ReportException(Exception e) 181catch (Exception e) when (ReportException(e))
ProjectSystem\InvisibleEditor.cs (1)
182catch (Exception ex) when (FatalError.ReportAndPropagate(ex, ErrorSeverity.Critical)) // critical severity, since this means we're not saving edited files
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (3)
37private Exception? _error; 85catch (Exception e) when (SaveMetadataReadingException(e)) 90bool SaveMetadataReadingException(Exception e)
ProjectSystem\OpenTextBufferProvider.cs (1)
86catch (Exception e) when (FatalError.ReportAndCatch(e, ErrorSeverity.Critical))
ProjectSystem\RuleSets\VisualStudioRuleSetManager.RuleSetFile.cs (4)
34private Exception _exception; 57catch (Exception e) 84public Exception GetException() 140catch (Exception e)
ProjectSystem\VisualStudioWorkspaceImpl.cs (1)
471catch (Exception)
Remote\VisualStudioRemoteHostClientProvider.cs (1)
134catch (Exception e) when (FatalError.ReportAndCatchUnlessCanceled(e))
StackTraceExplorer\StackFrameViewModel.cs (3)
71catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken)) 100catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken)) 138catch (Exception ex) when (FatalError.ReportAndCatchUnlessCanceled(ex, cancellationToken))
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
359catch (Exception ex) when (FatalError.ReportAndCatch(ex))
Utilities\Exceptions.cs (4)
14public static Exception ThrowEFail() 22public static Exception ThrowEInvalidArg() 30public static Exception ThrowENotImpl() 38public static Exception ThrowEUnexpected()
Utilities\VisualStudioCommandHandlerHelpers.cs (1)
57catch (Exception)
Watson\FaultReporter.cs (7)
109public static void ReportFault(Exception exception, FaultSeverity severity, bool forceDump) 122foreach (var innerException in aggregateException.Flatten().InnerExceptions) 186catch (Exception e) 192private static void UpdateBlamedMethod(IFaultUtility faultUtility, Exception exception) 225private static string GetDescription(Exception exception) 275catch (Exception) 297catch (Exception)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CSharpPackage.cs (1)
77catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.General))
Options\AutomationObject\AutomationObject.Naming.cs (1)
23catch (Exception)
SemanticSearch\SemanticSearchToolWindowImpl.cs (1)
386catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken, ErrorSeverity.Critical))
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (8)
GlyphExtensionsTests.cs (1)
141Assert.ThrowsAny<Exception>(() =>
PersistentStorage\AbstractPersistentStorageTests.cs (4)
914var exceptions = new List<Exception>(); 924catch (Exception ex) 946var exceptions = new List<Exception>(); 957catch (Exception ex)
PersistentStorage\SQLiteV2PersistentStorageTests.cs (3)
65private readonly Action<Exception>? _onFatalError; 69Action<Exception>? onFatalError = null) 78public void OnFatalError(Exception ex)
Microsoft.VisualStudio.LanguageServices.DevKit (1)
Logging\VSCodeTelemetryLogger.cs (1)
100public void ReportFault(string eventName, string description, int logLevel, bool forceDump, int processId, Exception exception)
Microsoft.VisualStudio.LanguageServices.LiveShare (3)
Client\Projects\RemoteProjectInfoProvider.cs (1)
42catch (Exception)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
58catch (Exception)
Client\RemoteLanguageServiceWorkspaceHost.cs (1)
144catch (Exception ex)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Telemetry\IRequestScope.cs (1)
16void RecordFailure(Exception? exception = null);
MiddlewareAnalysisSample (1)
Startup.cs (1)
107public virtual void OnMiddlewareException(Exception exception, string name)
MSBuild (85)
AutomaticEncodingRestorer.cs (2)
43catch (Exception ex) when (ex is IOException || ex is SecurityException) 62catch (Exception ex) when (ex is IOException || ex is SecurityException)
CommandLineSwitches.cs (3)
811private Exception _innerException; 841internal void SetParameterError(string messageResourceNameValue, string badCommandLineArgValue, Exception innerExceptionValue, string commandLine) 853private void SetError(string messageResourceNameValue, string badCommandLineArgValue, Exception innerExceptionValue, bool isParameterErrorValue, string commandLine)
ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
InitializationException.cs (1)
141internal static void Throw(string messageResourceName, string invalidSwitch, Exception e, bool showStackTrace)
InterningBinaryReader.cs (1)
171catch (Exception e)
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NodeEndpointOutOfProcBase.cs (5)
473catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 508catch (Exception) 558catch (Exception e) 602catch (Exception e) 651catch (Exception e)
NodeShutdown.cs (3)
46private Exception _exception; 59public NodeShutdown(NodeShutdownReason reason, Exception e) 95public Exception Exception
OutOfProcTaskAppDomainWrapperBase.cs (9)
118catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 201Exception exceptionFromExecution = null; 222catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 306catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 308Exception exceptionToReturn = e; 331catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 353catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 370catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
OutOfProcTaskHostNode.cs (4)
633public NodeEngineShutdownReason Run(out Exception shutdownException) 832catch (Exception ex) 945catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 981catch (Exception e)
OutOfProcTaskHostTaskResult.cs (4)
39internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException) 48internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 57internal OutOfProcTaskHostTaskResult(TaskCompleteType result, IDictionary<string, Object> finalParams, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 111public Exception TaskException
PrintLineDebuggerWriters.cs (1)
30catch (Exception e)
RegisteredTaskObjectCacheBase.cs (1)
151catch (Exception ex) when (!ExceptionHandling.IsCriticalException(ex))
TaskHostTaskComplete.cs (2)
68private Exception _taskException; 159public Exception TaskException
TaskParameter.cs (3)
107if (wrappedParameter is Exception) 253Exception exceptionParam = (Exception)_wrappedParameter;
TempFileUtilities.cs (1)
197catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
XMake.cs (15)
190private static void HandleConfigurationException(Exception ex) 196Exception exception = ex; 340catch (Exception ex) 1043catch (Exception e) 1555Exception exception = null; 1641catch (Exception ex) 1724catch (Exception ex) 1922catch (Exception ex) when (ex is IOException || ex is SecurityException) 3225catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 3244catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 3402Exception nodeException = null; 4107catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 4414catch (Exception e) when (loggerDescription.IsOptional) 4437catch (Exception e) 4488catch (Exception ex)
MSBuildTaskHost (85)
BinaryTranslator.cs (2)
512public void TranslateException(ref Exception value) 1213public void TranslateException(ref Exception value)
BuildExceptionBase.cs (4)
29Exception? inner) 73internal static void WriteExceptionToTranslator(ITranslator translator, Exception exception) 116internal static Exception ReadExceptionFromTranslator(ITranslator translator) 119Exception? innerException = null;
BuildExceptionSerializationHelper.cs (9)
14public TypeConstructionTuple(Type type, Func<string, Exception?, BuildExceptionBase> factory) 21public Func<string, Exception?, BuildExceptionBase> Factory { get; } 24private static Dictionary<string, Func<string, Exception?, BuildExceptionBase>>? s_exceptionFactories; 26private static readonly Func<string, Exception?, BuildExceptionBase> s_defaultFactory = 33type.IsSubclassOf(typeof(Exception)) && 49var exceptionFactories = new Dictionary<string, Func<string, Exception?, BuildExceptionBase>>(); 54Func<string, Exception?, BuildExceptionBase> exceptionFactory = typeConstructionTuple.Factory; 76internal static Func<string, Exception?, BuildExceptionBase> CreateExceptionFactory(string serializationType) 78Func<string, Exception?, BuildExceptionBase>? factory = null;
ChangeWaves.cs (1)
200catch (Exception)
D\a\_work\1\s\bin\repo\msbuild\src\Framework\ErrorUtilities.cs\ErrorUtilities.cs (1)
53internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args)
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (8)
67internal static void ThrowInternalError(string message, Exception? innerException, params object?[]? args) 354internal static void ThrowArgument(Exception? innerException, string resourceName, params object?[]? args) 406internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName) 418internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0) 431internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1) 444internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2) 457internal static void VerifyThrowArgument([DoesNotReturnIf(false)] bool condition, Exception? innerException, string resourceName, object arg0, object arg1, object arg2, object arg3) 585throw new ArgumentNullException(ResourceUtilities.FormatResourceStringStripCodeAndKeyword(resourceName, parameterName), (Exception?)null);
ExceptionHandling.cs (13)
100internal static bool IsCriticalException(Exception e) 145internal static bool NotExpectedException(Exception e) 155internal static bool IsIoRelatedException(Exception e) 175internal static bool IsXmlException(Exception e) 189internal static LineAndColumn GetXmlLineAndColumn(Exception e) 224internal static bool NotExpectedIoOrXmlException(Exception e) 242internal static bool NotExpectedReflectionException(Exception e) 276internal static bool NotExpectedSerializationException(Exception e) 292internal static bool NotExpectedRegistryException(Exception e) 309internal static bool NotExpectedFunctionException(Exception e) 329Exception ex = (Exception)e.ExceptionObject; 336internal static void DumpExceptionToFile(Exception ex)
FileUtilities.cs (8)
81catch (Exception exc) 194catch (Exception) 789catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 863catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 900catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex)) 932catch (Exception ex) when (ex is IOException || ex is UnauthorizedAccessException) 968catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e)) 1232catch (Exception ex) when (ExceptionHandling.IsIoRelatedException(ex))
GenericBuildTransferredException.cs (1)
19Exception? inner)
InternalErrorException.cs (4)
48Exception innerException) : 52internal static InternalErrorException CreateFromRemote(string message, Exception innerException) 57private InternalErrorException(string message, Exception innerException, bool calledFromDeserialization) 111private static void ConsiderDebuggerLaunch(string message, Exception innerException)
InterningBinaryReader.cs (1)
171catch (Exception e)
ITranslator.cs (1)
270void TranslateException(ref Exception value);
Modifiers.cs (1)
600catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
NodeEndpointOutOfProcBase.cs (5)
473catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 508catch (Exception) 558catch (Exception e) 602catch (Exception e) 651catch (Exception e)
NodeShutdown.cs (3)
46private Exception _exception; 59public NodeShutdown(NodeShutdownReason reason, Exception e) 95public Exception Exception
OutOfProcTaskAppDomainWrapperBase.cs (9)
118catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 201Exception exceptionFromExecution = null; 222catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 306catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 308Exception exceptionToReturn = e; 331catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 353catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 370catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
OutOfProcTaskHost.cs (1)
103Exception taskHostShutDownException = null;
OutOfProcTaskHostNode.cs (4)
633public NodeEngineShutdownReason Run(out Exception shutdownException) 832catch (Exception ex) 945catch (Exception e) when (!ExceptionHandling.IsCriticalException(e)) 981catch (Exception e)
OutOfProcTaskHostTaskResult.cs (4)
39internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException) 48internal OutOfProcTaskHostTaskResult(TaskCompleteType result, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 57internal OutOfProcTaskHostTaskResult(TaskCompleteType result, IDictionary<string, Object> finalParams, Exception taskException, string exceptionMessage, string[] exceptionMessageArgs) 111public Exception TaskException
TaskHostTaskComplete.cs (2)
68private Exception _taskException; 159public Exception TaskException
TaskParameter.cs (3)
107if (wrappedParameter is Exception) 253Exception exceptionParam = (Exception)_wrappedParameter;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
228[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Exception))]
netstandard (1)
netstandard.cs (1)
786[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Exception))]
PresentationBuildTasks (39)
Microsoft\Build\Tasks\Windows\FileClassifier.cs (1)
99catch (Exception e)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (2)
211catch (Exception e) 327catch (Exception e)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (1)
178catch (Exception e)
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (1)
132catch (Exception e)
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
87catch (Exception e)
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (1)
198catch (Exception e)
Microsoft\Build\Tasks\Windows\UidManager.cs (4)
94catch (Exception e) 392catch (Exception e) 989catch (Exception e) 1028catch (Exception e)
Microsoft\Build\Tasks\Windows\UpdateManifestForBrowserApplication.cs (1)
126catch (Exception e)
MS\Internal\MarkupCompiler\CompilationUnit.cs (3)
105internal MarkupErrorEventArgs(Exception e, int lineNum, int linePos, string fileName) 120public Exception Exception 155private Exception _e;
MS\Internal\MarkupCompiler\MarkupCompiler.cs (4)
490catch (Exception e) 543catch (Exception e) 748Exception compilerException = new Exception(message); 752internal void OnError(Exception e)
MS\Internal\Tasks\CompilerWrapper.cs (1)
323private bool IsXmlException(Exception e)
MS\Internal\Tasks\TaskHelper.cs (3)
191internal static string GetWholeExceptionMessage(Exception exception) 193Exception e = exception; 198Exception eInner = e.InnerException;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
1065catch (Exception e)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParseException.cs (5)
63public XamlParseException(string message, Exception innerException) 105public XamlParseException(string message, int lineNumber, int linePosition, Exception innerException) 112internal XamlParseException(string message, int lineNumber, int linePosition, Uri baseUri, Exception innerException) 410Exception innerException, 518Exception innerException,
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (1)
188catch (Exception e)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (3)
414catch (Exception e) 1377Exception innerException) 3139catch (Exception e)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (2)
2634catch (Exception e) 3807internal void ThrowExceptionWithLine(string message, Exception innerException)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (3)
20internal static bool IsCriticalException(Exception ex) 46internal static Exception Unwrap(Exception ex)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
99catch (Exception e) when (!CriticalExceptions.IsCriticalException(e))
PresentationCore (124)
MS\Internal\AppModel\CookieHandler.cs (2)
50catch (Exception ex) // Attaching cookies shouldn't fail a web request. 88catch (Exception ex) // A malformed cookie shouldn't fail the whole web request.
MS\Internal\Automation\ElementUtil.cs (2)
186Exception remoteException = null; 198catch(Exception e)
MS\Internal\DpiUtil\DpiUtil+DpiAwarenessContextHelper.cs (1)
51catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException)
MS\Internal\DpiUtil\DpiUtil+DpiAwarenessScope.cs (1)
120catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException)
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (2)
71catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException) 75catch (Exception e) when (e is ArgumentException || e is UnauthorizedAccessException || e is COMException)
MS\Internal\DpiUtil\DpiUtil+SystemDpiHelper.cs (1)
53catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException)
MS\Internal\DpiUtil\DpiUtil+WindowDpiScaleHelper.cs (3)
51catch (Exception e) when (e is EntryPointNotFoundException || e is MissingMethodException || e is DllNotFoundException) 55catch (Exception e) when (e is COMException) 66catch (Exception e) when (e is COMException)
MS\Internal\FontCache\FontCacheUtil.cs (1)
765internal static Exception ConvertInPageException(FontSource fontSource, SEHException e)
MS\Internal\FontFace\CompositeFontParser.cs (4)
193catch (Exception x) when(string.Equals(x.GetType().FullName, "System.Security.XmlSyntaxException", StringComparison.OrdinalIgnoreCase)) 871private void FailNotWellFormed(Exception x) 889private void FailAttributeValue(Exception x) 940private void Fail(string message, Exception innerException)
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (2)
553catch (Exception e) // catch (and re-throw) exceptions so we can inform the other thread 842private Exception _erroredOutException;
MS\Internal\Text\TextInterface\DWriteUtil.cs (1)
55System.Exception e = System.Runtime.InteropServices.Marshal.GetExceptionForHR(hr);
MS\Internal\TextFormatting\FullTextBreakpoint.cs (1)
83Exception callbackException = context.CallbackException;
MS\Internal\TextFormatting\FullTextLine.cs (9)
293Exception callbackException = context.CallbackException; 401private static Exception WrapException(Exception caughtException) 411new Type[] { typeof(Exception) } 415return (Exception)constructor.Invoke( 422new Type[] { typeof(string), typeof(Exception) } 426return (Exception)constructor.Invoke( 614Exception callbackException = context.CallbackException; 2143Exception callbackException = context.CallbackException;
MS\Internal\TextFormatting\LineServicesCallbacks.cs (32)
218catch (Exception e) 343catch (Exception e) 387catch (Exception e) 433catch (Exception e) 527catch (Exception e) 558catch (Exception e) 636catch (Exception e) 700catch (Exception e) 753catch (Exception e) 813catch (Exception e) 850catch (Exception e) 892catch (Exception e) 957catch (Exception e) 1010catch (Exception e) 1467catch (Exception e) 1517catch (Exception e) 1652catch (Exception e) 1734catch (Exception e) 1840catch (Exception e) 1890catch (Exception e) 1940catch (Exception e) 2044catch (Exception e) 2176catch (Exception e) 2320catch (Exception e) 2392catch (Exception e) 2556catch (Exception e) 2685catch (Exception e) 2767catch (Exception e) 3388private void SaveException(Exception e, Plsrun plsrun, LSRun lsrun) 3396Exception e = new System.Exception(SR.NonCLSException); 3427private Exception _exception; 3429internal Exception Exception
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPane.cs (1)
195catch (Exception e) when (e is TypeLoadException
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettings.cs (1)
120catch (Exception e) when (e is TypeLoadException || e is FileNotFoundException)
src\Microsoft.DotNet.Wpf\src\Common\Graphics\wgx_render.cs (2)
774internal static Exception ConvertHRToException(int hr) 776Exception exceptionForHR = Marshal.GetExceptionForHR(hr, (IntPtr)(-1));
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (2)
132internal static Exception GetExceptionForHR(int hr) 144internal static int GetHRForException(Exception exception)
src\Microsoft.DotNet.Wpf\src\Shared\System\IO\FileHelper.cs (1)
133catch (Exception e) when (retries > 0 && (e is IOException || e is UnauthorizedAccessException))
System\IO\Packaging\PackWebResponse.cs (1)
932private Exception _responseException; // actual exception to throw (if any)
System\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
608catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\BinaryFormat\ExceptionExtensions.cs (1)
14public static bool IsCriticalException(this Exception ex)
System\Windows\dataobject.cs (2)
1672catch (Exception ex) when (!ex.IsCriticalException()) 3017catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Documents\GetPageCompletedEventArgs.cs (1)
34public GetPageCompletedEventArgs(DocumentPage page, int pageNumber, Exception error, bool cancelled, object userState)
System\Windows\Documents\GetPageNumberCompletedEventArgs.cs (1)
34public GetPageNumberCompletedEventArgs(ContentPosition contentPosition, int pageNumber, Exception error, bool cancelled, object userState)
System\Windows\Input\Stylus\Common\StylusLogic.cs (1)
288catch (Exception e) when (e is IOException)
System\Windows\Input\Stylus\Common\StylusTraceLogger.cs (1)
280where T : Exception, new()
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (6)
150catch (Exception e) when (PenThreadWorker.IsKnownException(e)) 205catch (Exception e) when (PenThreadWorker.IsKnownException(e)) 313catch (Exception e) when (PenThreadWorker.IsKnownException(e)) 354catch (Exception e) when (PenThreadWorker.IsKnownException(e)) 395catch (Exception e) when (PenThreadWorker.IsKnownException(e)) 1132private static bool IsKnownException(Exception e)
System\Windows\InterOp\HwndTarget.cs (1)
1457catch (Exception e)
System\Windows\Markup\IProvidePropertyFallback.cs (1)
26object ProvidePropertyFallback(string property, Exception cause);
System\Windows\Media\Animation\AnimationException.cs (1)
39string message, Exception innerException)
System\Windows\Media\Animation\AnimationStorage.cs (1)
481catch (Exception e)
System\Windows\Media\DrawingCollection.cs (1)
47catch (Exception)
System\Windows\Media\EventProxy.cs (1)
92catch (Exception e)
System\Windows\Media\ImageSourceConverter.cs (1)
141catch (Exception e)
System\Windows\Media\Imaging\BitmapDownload.cs (5)
145catch(Exception e) 215catch (Exception e) 251catch (Exception e) 269catch (Exception e) 392Exception e
System\Windows\Media\Imaging\BitmapImage.cs (1)
596catch (Exception e)
System\Windows\Media\Imaging\BitmapSource.cs (3)
827catch (Exception e) 883catch (Exception e) 980internal void RecoverFromDecodeFailure(Exception e)
System\Windows\Media\Imaging\LateBoundBitmapDecoder.cs (2)
303catch(Exception e) 334_failedEvent.InvokeEvents(this, new ExceptionEventArgs((Exception)arg));
System\Windows\Media\InvalidWMPVersionException.cs (1)
55public InvalidWmpVersionException(string message, Exception innerException) : base(message, innerException)
System\Windows\Media\mediaeventargs.cs (3)
21internal ExceptionEventArgs(Exception errorException) 32public Exception ErrorException 43private Exception _errorException;
System\Windows\Media\mediaeventshelper.cs (1)
214internal void RaiseMediaFailed(Exception e)
System\Windows\Media\StreamAsIStream.cs (14)
121private Exception _lastException; 162catch (Exception e) 181catch (Exception e) 238catch (Exception e) 254catch (Exception e) 275catch (Exception e) 291catch (Exception e) 363catch (Exception e) 381catch (Exception e) 406catch (Exception e) 422catch (Exception e) 446catch (Exception e) 466catch (Exception e) 486catch (Exception e)
System\Windows\Media\textformatting\TextFormatterContext.cs (1)
194internal Exception CallbackException
System\Windows\Media\textformatting\TextParagraphCache.cs (1)
66Exception callbackException = context.CallbackException;
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
22catch (Exception ex) when (ex is KeyNotFoundException or InvalidCastException)
PresentationCore.Tests (1)
TestUtilities\BinaryFormatTestExtensions.cs (1)
54catch (Exception)
PresentationFramework (368)
MS\Internal\AppModel\ContentFilePart.cs (1)
106catch (Exception ex)
MS\Internal\AppModel\Journaling.cs (1)
678catch (Exception ex)
MS\Internal\AppModel\ReturnEventSaver.cs (1)
130catch (Exception ex)
MS\Internal\Controls\ActiveXSite.cs (3)
212catch (Exception t) 355catch (Exception t) 443catch (Exception ex)
MS\Internal\Controls\ConnectionPointCookie.cs (4)
21Exception ex = null; 32catch (Exception e) 100catch (Exception ex) 117catch (Exception ex)
MS\Internal\Data\AsyncDataRequest.cs (3)
71public Exception Exception { get { return _exception; } } 147public void Fail(Exception exception) 215Exception _exception;
MS\Internal\Data\ClrBindingWorker.cs (4)
465internal void ReportGetValueError(int k, object item, Exception ex) 480internal void ReportSetValueError(int k, object item, object value, Exception ex) 750Exception exception = filteredException as Exception;
MS\Internal\Data\DefaultAsyncDataDispatcher.cs (1)
74catch (Exception ex)
MS\Internal\Data\PropertyPathWorker.cs (4)
540catch (Exception ex) 1409catch (Exception ex) 1522catch (Exception ex) // if error getting value, we will use fallback/default instead 1618catch (Exception ex2)
MS\Internal\Data\RBTree.cs (1)
124catch (Exception e)
MS\Internal\DataStreams.cs (2)
129catch (Exception ex) when (!ex.IsCriticalException()) 258catch (Exception ex) when (!ex.IsCriticalException())
MS\Internal\Documents\UndoManager.cs (2)
500/// <exception cref="Exception"> 565/// <exception cref="Exception">
MS\Internal\IO\Packaging\XpsFilter.cs (1)
555catch (Exception ex)
MS\Internal\Printing\PrintDlgExMarshaler.cs (1)
617catch (Exception)
MS\Internal\Printing\Win32PrintDialog.cs (1)
104catch(Exception e)
MS\Internal\PtsHost\Pts.cs (5)
95Exception innerException = GetInnermostException(ptsContext); 130private static Exception GetInnermostException(PtsContext ptsContext) 133Exception exception = ptsContext.CallbackException; 134Exception innerException = exception; 267internal SecondaryException(Exception e) : base(null, e) { }
MS\Internal\PtsHost\PtsContext.cs (2)
406internal Exception CallbackException 592private Exception _callbackException;
MS\Internal\PtsHost\PtsHost.cs (89)
155catch (Exception e) 195catch (Exception e) 238catch (Exception e) 268catch (Exception e) 299catch (Exception e) 326catch (Exception e) 358catch (Exception e) 393catch (Exception e) 421catch (Exception e) 456catch (Exception e) 491catch (Exception e) 517catch (Exception e) 547catch (Exception e) 600catch (Exception e) 630catch (Exception e) 658catch (Exception e) 685catch (Exception e) 713catch (Exception e) 737catch (Exception e) 765catch (Exception e) 788catch (Exception e) 824catch (Exception e) 851catch (Exception e) 974catch (Exception e) 999catch (Exception e) 1032catch (Exception e) 1071catch (Exception e) 1106catch (Exception e) 1159catch (Exception e) 1203catch (Exception e) 1229catch (Exception e) 1328catch (Exception e) 1386catch (Exception e) 1445catch (Exception e) 1565catch (Exception e) 1625catch (Exception e) 1662catch (Exception e) 1687catch (Exception e) 1731catch (Exception e) 1760catch (Exception e) 1788catch (Exception e) 1826catch (Exception e) 1930catch (Exception e) 1986catch (Exception e) 2042catch (Exception e) 2100catch (Exception e) 2128catch (Exception e) 2170catch (Exception e) 2200catch (Exception e) 2251catch (Exception e) 2293catch (Exception e) 2336catch (Exception e) 2376catch (Exception e) 2591catch (Exception e) 2627catch (Exception e) 2710catch (Exception e) 2766catch (Exception e) 2824catch (Exception e) 2857catch (Exception e) 3025catch (Exception e) 3081catch (Exception e) 3139catch (Exception e) 3272catch (Exception e) 3302catch (Exception e) 3335catch (Exception e) 3367catch (Exception e) 3396catch (Exception e) 3428catch (Exception e) 3459catch (Exception e) 3491catch (Exception e) 3521catch (Exception e) 3552catch (Exception e) 3588catch (Exception e) 3626catch (Exception e) 3662catch (Exception e) 3693catch (Exception e) 3723catch (Exception e) 3751catch (Exception e) 3781catch (Exception e) 3808catch (Exception e) 3845catch (Exception e) 3891catch (Exception e) 3936catch (Exception e) 3983catch (Exception e) 4045catch (Exception e) 4081catch (Exception e) 4106catch (Exception e) 4133catch (Exception e) 4161catch (Exception e)
MS\Internal\TraceData.cs (3)
288static public string IdentifyException(Exception ex) 302public static void TraceAndNotify(TraceEventType eventType, AvTraceDetails traceDetails, BindingExpressionBase binding, Exception exception = null) 319public static void TraceAndNotify(TraceEventType eventType, AvTraceDetails traceDetails, Exception exception = null)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (29)
476catch (Exception __exception__) 495catch (Exception __exception__) 514catch (Exception __exception__) 648catch (Exception __exception__) 670catch (Exception __exception__) 689catch (Exception __exception__) 708catch (Exception __exception__) 727catch (Exception __exception__) 746catch (Exception __exception__) 765catch (Exception __exception__) 784catch (Exception __exception__) 803catch (Exception __exception__) 822catch (Exception __exception__) 841catch (Exception __exception__) 860catch (Exception __exception__) 879catch (Exception __exception__) 898catch (Exception __exception__) 917catch (Exception __exception__) 936catch (Exception __exception__) 955catch (Exception __exception__) 1160catch (Exception __exception__) 1179catch (Exception __exception__) 1198catch (Exception __exception__) 1312catch (Exception __exception__) 1331catch (Exception __exception__) 1347catch (Exception __exception__) 1366catch (Exception __exception__) 1500catch (Exception __exception__) 1644catch (Exception __exception__)
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (10)
251catch (Exception __exception__) 270catch (Exception __exception__) 289catch (Exception __exception__) 308catch (Exception __exception__) 435catch (Exception __exception__) 509catch (Exception __exception__) 590catch (Exception __exception__) 673catch (Exception __exception__) 692catch (Exception __exception__) 789catch (Exception __exception__)
MS\Internal\WindowsRuntime\Generated\WinRT.cs (2)
134catch (Exception) { } 244catch (Exception) { }
MS\Internal\WindowsRuntime\Generated\WinRT\ExceptionHelpers.cs (16)
64Exception ex = GetExceptionForHR(hr, useGlobalErrorState: true, out bool restoredExceptionFromGlobalState); 75public static Exception GetExceptionForHR(int hr) => GetExceptionForHR(hr, false, out _); 77private static Exception GetExceptionForHR(int hr, bool useGlobalErrorState, out bool restoredExceptionFromGlobalState) 87Exception ex; 114ex = ComWrappersSupport.FindObject<Exception>(languageException.ThisPtr); 164public static unsafe void SetErrorInfo(Exception ex) 203public static void ReportUnhandledError(Exception ex) 214public static int GetHRForException(Exception ex) 256this Exception ex, 280this Exception ex, 298public static Exception AttachRestrictedErrorInfo(Exception e) 353public static void SetHResult(this Exception ex, int value) 358internal static Exception GetExceptionForHR(this Exception innerException, int hresult, string messageResource) 360Exception e;
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (2)
58catch (Exception ex) 73catch (Exception ex)
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\ExceptionErrorInfo.cs (8)
45private readonly Exception _exception; 47public ManagedExceptionErrorInfo(Exception ex) 119catch (Exception ex) 136catch (Exception ex) 154catch (Exception ex) 172catch (Exception ex) 190catch (Exception ex) 352catch (Exception ex)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (10)
59catch (Exception) when (dispose()) 153catch (Exception) when (dispose()) 217catch (Exception) when (dispose()) 243catch (Exception) when (dispose()) 471catch (Exception) when (dispose()) 548catch (Exception) when (dispose()) 577catch (Exception) when (dispose()) 651catch (Exception) when (dispose()) 706catch (Exception) when (dispose()) 734catch (Exception) when (dispose())
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (6)
132catch (Exception __exception__) 297catch (Exception e) 479catch (Exception __exception__) 500catch (Exception __exception__) 518catch (Exception __exception__) 537catch (Exception __exception__)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (6)
94catch (Exception ex) 123Exception e = new ArgumentOutOfRangeException(nameof(index), ErrorStrings.ArgumentOutOfRange_IndexLargerThanMaxValue); 268catch (Exception __exception__) 290catch (Exception __exception__) 311catch (Exception __exception__) 330catch (Exception __exception__)
MS\Internal\WindowsRuntime\Generated\WinRT\TypeExtensions.cs (2)
13if (typeof(Exception).IsAssignableFrom(type)) 15type = typeof(Exception);
MS\Internal\WindowsRuntime\Windows\Data\Text\WordsSegmenter.cs (1)
69catch (Exception e)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (1)
132internal static Exception GetExceptionForHR(int hr)
System\Windows\Automation\Peers\DataGridColumnHeadersPresenterAutomationPeer.cs (1)
222catch (Exception ex)
System\Windows\Automation\Peers\DataGridItemAutomationPeer.cs (1)
184catch (Exception ex)
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (1)
298catch(Exception ex)
System\Windows\Controls\DataErrorValidationRule.cs (1)
80catch (Exception ex)
System\Windows\Controls\DatePickerDateValidationErrorEventArgs.cs (2)
19public DatePickerDateValidationErrorEventArgs(Exception exception, string text) 28public Exception Exception
System\Windows\Controls\ExceptionRoutedEventArgs.cs (3)
20Exception errorException 31public Exception ErrorException 39private Exception _errorException;
System\Windows\Controls\Image.cs (2)
324catch(Exception e) 497object IProvidePropertyFallback.ProvidePropertyFallback(string property, Exception cause)
System\Windows\Controls\ItemContainerGenerator.cs (1)
1099Exception exception = new Exception(sb.ToString());
System\Windows\Controls\Primitives\Popup.cs (4)
1869Exception nre = new NullReferenceException(); 1912private static readonly UncommonField<Exception> SavedExceptionField = new UncommonField<Exception>(); 1914internal Exception SavedException
System\Windows\Controls\Primitives\PopupRoot.cs (1)
148catch (Exception e)
System\Windows\Controls\PrintDialogException.cs (1)
48Exception innerException
System\Windows\Controls\ValidationError.cs (3)
28public ValidationError(ValidationRule ruleInError, object bindingInError, object errorContent, Exception exception) 85public Exception Exception 113private Exception _exception;
System\Windows\Data\Binding.cs (1)
671internal object DoFilterException(object bindExpr, Exception exception)
System\Windows\Data\BindingExpression.cs (7)
32public delegate object UpdateSourceExceptionFilterCallback(object bindExpression, Exception exception); 1642catch (Exception ex) 1695catch (Exception ex) 1980catch (Exception ex) 2169private void ProcessException(Exception ex, bool validate) 2310catch (Exception ex) 2529private object CallDoFilterException(Exception ex)
System\Windows\Data\BindingExpressionBase.cs (4)
2125Exception e; 2151Exception e; 2171static object ConvertValue(object value, DependencyProperty dp, out Exception e) 2198catch (Exception ex)
System\Windows\Data\BindingGroup.cs (2)
1073catch (Exception ex) 1244catch (Exception ex)
System\Windows\Data\BindingOperations.cs (5)
569internal static void LogException(Exception ex) 580internal void LogException(Exception ex) 591internal List<Exception> Log { get { return _log; } } 593List<Exception> _log = new List<Exception>();
System\Windows\Data\MultiBinding.cs (1)
363internal object DoFilterException(object bindExpr, Exception exception)
System\Windows\Data\ObjectDataProvider.cs (6)
378Exception e = null; // exception to pass back to main thread 388Exception exInstantiation = null; 433object CreateObjectInstance(out Exception e) 471catch (Exception ex) 503object InvokeMethodOnInstance(out Exception e) 548catch (Exception ex)
System\Windows\Data\ValueUnavailableException.cs (1)
40public ValueUnavailableException(string message, Exception innerException) : base(message, innerException)
System\Windows\Data\XmlDataProvider.cs (3)
465Exception ex = null; 555Exception ex = null; 588catch (Exception e)
System\Windows\DataTemplate.cs (2)
44Exception ex = TemplateKey.ValidateDataType(dataType, "dataType"); 74Exception ex = TemplateKey.ValidateDataType(value, "value");
System\Windows\Documents\DocumentSequence.cs (1)
919private void _NotifyGetPageAsyncCompleted(DocumentPage page, int pageNumber, Exception error, bool cancelled, object userState)
System\Windows\Documents\FixedDocument.cs (3)
663catch (Exception e) 949catch (Exception e) 1254private void _NotifyGetPageAsyncCompleted(DocumentPage page, int pageNumber, Exception error, bool cancelled, object userState)
System\Windows\Documents\FixedFindEngine.cs (1)
412catch (Exception)
System\Windows\Documents\ITextView.cs (4)
595public BringPositionIntoViewCompletedEventArgs(ITextPointer position, bool succeeded, Exception error, bool cancelled, object userState) 623public BringPointIntoViewCompletedEventArgs(Point point, ITextPointer position, bool succeeded, Exception error, bool cancelled, object userState) 692public BringLineIntoViewCompletedEventArgs(ITextPointer position, double suggestedX, int count, ITextPointer newPosition, double newSuggestedX, int linesMoved, bool succeeded, Exception error, bool cancelled, object userState) 808public BringPageIntoViewCompletedEventArgs(ITextPointer position, Point suggestedOffset, int count, ITextPointer newPosition, Point newSuggestedOffset, int pagesMoved, bool succeeded, Exception error, bool cancelled, object userState)
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerFactory.cs (1)
162catch (Exception e) when (suppressOtherExceptions && !(e is COMException) && !(e is UnauthorizedAccessException))
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (7)
69catch (Exception e) when (MatchException(e, ignoredExceptions)) 125catch (Exception e) when (MatchException(e, ignoredExceptions)) 192catch (Exception e) when (MatchException(e, ignoredExceptions)) 254catch (Exception e) when (MatchException(e, ignoredExceptions)) 282private static bool MatchException(Exception exception, List<Type> exceptions) 301Invariant.Assert(exceptions.TrueForAll((t) => typeof(Exception).IsAssignableFrom(t))); 314internal RetriesExhaustedException(string message, Exception innerException) : base(message, innerException) { }
System\Windows\Documents\NLGSpellerInterop.cs (1)
972catch (Exception e)
System\Windows\Documents\PageContent.cs (2)
472private void _NotifyPageCompleted(FixedPage result, Exception error, bool cancelled, object userToken) 640internal GetPageRootCompletedEventArgs(FixedPage page, Exception error, bool cancelled, object userToken)
System\Windows\Documents\PageContentAsyncResult.cs (2)
203internal Exception Exception 255private Exception _exception;
System\Windows\Documents\Serialization\SerializerWriterEventHandlers.cs (4)
132Exception exception): base(exception, cancelled, state) 198Exception exception 208Exception 218private Exception _exception;
System\Windows\Documents\Speller.cs (2)
361catch(Exception e) 1587catch (Exception e)
System\Windows\Documents\SpellerInteropBase.cs (1)
136catch (Exception ex) when
System\Windows\Documents\WinRTSpellerInterop.cs (4)
44catch (Exception ex) 62catch (Exception ex) when (ex is ArgumentException || ex is NotSupportedException || ex is PlatformNotSupportedException) 312catch (Exception ex) 479catch (Exception e) when ((e is ArgumentException) || !fileCopied)
System\Windows\Documents\WpfPayload.cs (1)
292/// <exception cref="Exception">
System\Windows\FrameworkTemplate.cs (1)
1057catch (Exception e)
System\Windows\Interop\ActiveXHost.cs (1)
658catch (Exception e)
System\Windows\Markup\BamlRecordReader.cs (18)
771catch (Exception e) 1534catch (Exception e) 1636catch( Exception e ) 2135Exception innerException = null; 2149catch (Exception e) 2206catch (Exception e) 2479catch( Exception e ) 2652catch (Exception e) 2894catch (Exception e) 3715catch (Exception e) 3853catch (Exception e) 3963catch (Exception e) 3983Exception e, 4500catch( Exception e ) 4765catch( Exception e ) 4993catch (Exception e) 5193internal void ThrowExceptionWithLine(string message, Exception innerException) 5311catch (Exception e)
System\Windows\Markup\WpfXamlLoader.cs (1)
164catch (Exception e)
System\Windows\Markup\XamlParseException.cs (6)
63public XamlParseException(string message, Exception innerException) 105public XamlParseException(string message, int lineNumber, int linePosition, Exception innerException) 112internal XamlParseException(string message, int lineNumber, int linePosition, Uri baseUri, Exception innerException) 410Exception innerException, 502internal static void ThrowException(ParserContext parserContext, int lineNumber, int linePosition, string message, Exception innerException) 518Exception innerException,
System\Windows\Markup\XamlReader.cs (11)
301internal static bool ShouldReWrapException(Exception e, Uri baseUri) 449catch (Exception e) 490internal static void RewrapException(Exception e, Uri baseUri) 495internal static void RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) 500internal static XamlParseException WrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) 502Exception baseException = e.InnerException ?? e; 640catch (Exception e) 902catch (Exception e) 975catch (Exception e) 1078catch (Exception e) 1176private Exception _parseException;
System\Windows\Markup\XamlTemplateSerializer.cs (2)
121Exception ex = TemplateKey.ValidateDataType(dataType, null); 161Exception innerException)
System\Windows\Markup\XamlTypeMapper.cs (3)
564catch (Exception e) 2634catch (Exception e) 3807internal void ThrowExceptionWithLine(string message, Exception innerException)
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
217catch (Exception e)
System\Windows\Navigation\NavigationFailedEventArgs.cs (3)
32internal NavigationFailedEventArgs(Uri uri, Object extraData, Object navigator, WebRequest request, WebResponse response, Exception e) 100public Exception Exception 128Exception _exception;
System\Windows\PropertyPath.cs (1)
800catch (Exception ex)
System\Windows\Shell\JumpList.cs (3)
776catch (Exception e) 973catch (Exception) 996catch (Exception)
System\Windows\Standard\ErrorCodes.cs (3)
416Exception e = MS.Internal.PresentationFramework.SecurityHelper.GetExceptionForHR((int)_value); 443e = cons.Invoke(new object[] { message }) as Exception; 461private static Exception CreateWin32Exception(int code, string message)
System\Windows\StyleHelper.cs (1)
5909catch (Exception ex)
System\Windows\TemplateKey.cs (4)
30Exception ex = ValidateDataType(dataType, "dataType"); 74Exception ex = ValidateDataType(value, "value"); 154internal static Exception ValidateDataType(object dataType, string argName) 156Exception result = null;
PresentationUI (11)
MS\Internal\Documents\Application\DocumentStream.cs (5)
168catch (Exception e) 419Exception exception = null; 601catch (Exception e) 773catch (Exception exception) 934catch(Exception e)
MS\Internal\Documents\Application\RightsManagementErrorHandler.cs (3)
70Exception exception) 194Exception exception, 242Exception exception,
MS\Internal\Documents\Application\XpsViewerException.cs (1)
57internal XpsViewerException(string message, Exception innerException)
MS\Internal\Documents\RightsManagementManager.cs (1)
1361catch (Exception exception)
MS\Internal\Documents\RMPublishingDialog.cs (1)
397catch (Exception e)
ReachFramework (36)
Exceptions\XpsException.cs (1)
48Exception innerException
Exceptions\XpsPackagingException.cs (1)
47Exception innerException
Exceptions\XpsSerializationException.cs (1)
47Exception innerException
PrintConfig\PrtCap_Public.cs (3)
40/// The exception object's <see cref="Exception.Message"/> property describes why the XML is not well-formed. And if not 41/// null, the exception object's <see cref="Exception.InnerException"/> property provides more details. 456internal static FormatException NewPrintCapFormatException(string detailMsg, Exception innerException)
PrintConfig\PrtCap_Public_Simple.cs (2)
194/// well-formed XML PrintCapabilities. The exception object's <see cref="Exception.Message"/> property describes 196/// <see cref="Exception.InnerException"/> property provides more details.
PrintConfig\PrtCap_Reader.cs (1)
493private static FormatException NewPrintCapFormatException(string detailMsg, Exception innerException)
PrintConfig\PrtTicket_Editor.cs (1)
401private static FormatException NewPTFormatException(string detailMsg, Exception innerException)
PrintConfig\PrtTicket_Public.cs (3)
59/// The exception object's <see cref="Exception.Message"/> property describes why the XML is not well-formed. 60/// And if not null, the exception object's <see cref="Exception.InnerException"/> property provides more details. 522internal static FormatException NewPTFormatException(string detailMsg, Exception innerException)
PrintConfig\PrtTicket_Public_Simple.cs (2)
263/// well-formed XML PrintTicket. The exception object's <see cref="Exception.Message"/> property describes 265/// <see cref="Exception.InnerException"/> property provides more details.
PrintSystemExceptions\PrintSystemException.cs (14)
127Exception innerException 189Exception innerException 373Exception innerException 452Exception innerException 537Exception innerException 602Exception innerException 685Exception innerException 865Exception innerException 1015Exception innerException 1039Exception innerException 1113Exception innerException 1152Exception innerException 1214Exception innerException 1264public PrintingNotSupportedException(string message, Exception innerException)
Serialization\Manager\NGCSerializationManagerAsync.cs (2)
169catch(Exception e) 283catch(Exception e)
Serialization\Manager\XpsOMSerializationManagerAsync.cs (2)
140catch (Exception e) when (!CriticalExceptions.IsCriticalException(e)) 239catch (Exception e) when (!CriticalExceptions.IsCriticalException(e))
Serialization\Manager\XpsSerializationManagerAsync.cs (3)
157catch(Exception e) 267catch(Exception e) 637Exception exception
Replay (15)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (4)
57internal static void LogException(this ICompilerServerLogger logger, Exception exception, string reason) 69Exception? e = exception.InnerException; 80void AppendException(Exception exception) 136catch (Exception e)
src\Compilers\Shared\BuildServerConnection.cs (11)
129catch (Exception) 141catch (Exception) 289catch (Exception e) 314catch (Exception e) 358catch (Exception e) 402catch (Exception e) when (e is IOException || e is TimeoutException) 428catch (Exception e) when (!(e is TaskCanceledException || e is OperationCanceledException)) 727catch (Exception) 774catch (Exception) 806catch (Exception) 825catch (Exception)
Roslyn.Compilers.Extension (1)
CompilerPackage.cs (1)
130catch (Exception e)
Roslyn.Test.PdbUtilities (7)
EditAndContinue\EditAndContinueTest.cs (3)
125var exceptions = new List<ImmutableArray<Exception>>(); 149private static string GetAggregateMessage(IReadOnlyList<ImmutableArray<Exception>> exceptions) 160foreach (var exception in exceptions[generation])
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (2)
25public readonly List<Exception> Exceptions = []; 42catch (Exception e)
EditAndContinue\EditAndContinueTestUtilities.cs (1)
27catch (Exception e) when (e is BadImageFormatException || e is IOException)
Writer\MockSymUnmanagedWriter.cs (1)
17private Exception MakeException() => new SymUnmanagedWriterException("MockSymUnmanagedWriter error message");
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
50catch (Exception e)
Roslyn.VisualStudio.Next.UnitTests (2)
Remote\SnapshotSerializationTests.cs (1)
274Assert.ThrowsAny<Exception>(() => validator.SolutionStateEqual(solutionId1, solutionId2));
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
131catch (Exception ex)
RunTests (11)
Logger.cs (3)
29internal static void LogError(Exception ex, string line) 39internal static void Log(string message, Exception ex) 49internal static void Log(Exception ex)
ProcessRunner.cs (1)
119catch (Exception ex)
ProcessTestExecutor.cs (1)
210catch (Exception ex)
Program.cs (2)
207catch (Exception ex) 254catch (Exception ex) when (!cancellationToken.IsCancellationRequested)
TestHistoryManager.cs (3)
162catch (Exception ex) 184catch (Exception ex) 199catch (Exception ex)
TestRunner.cs (1)
122catch (Exception ex)
ScenarioTests.Common.Tests (5)
ScenarioTestHelpers.cs (1)
141catch (Exception ex)
ScenarioTestTypes.cs (3)
743public bool HandleError(Exception error) 748public void ProvideFault(Exception error, MessageVersion version, ref Message msg) 1213catch (Exception)
ServiceInterfaces.cs (1)
455void ThrowingOperation(Exception exceptionToThrow);
Security.TransportSecurity.IntegrationTests (12)
Https\HttpsTests.4.1.0.cs (8)
94catch (Exception ex) 97for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 133catch (Exception ex) 136for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 172catch (Exception ex) 175for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 211catch (Exception ex) 214for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException)
Tcp\ClientCredentialTypeCertificateCanonicalNameTests.4.1.0.cs (2)
69catch (Exception exception) when (exception is CommunicationException || exception is MessageSecurityException) 145catch (Exception exception) when (exception is CommunicationException || exception is MessageSecurityException)
Tcp\ClientCredentialTypeTests.OSX.cs (2)
98Exception exception; 117internal bool TryValidate(X509Certificate2 certificate, out Exception exception)
SemanticSearch.BuildTask (6)
GenerateFilteredReferenceAssembliesTask.cs (3)
75catch (Exception e) 157catch (Exception) 169catch (Exception e)
src\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs (3)
19internal static Exception UnexpectedValue(object? o) 28internal static Exception Unreachable([CallerFilePath] string? path = null, [CallerLineNumber] int line = 0) 37internal static bool IsCurrentOperationBeingCancelled(Exception exception, CancellationToken cancellationToken)
ServerComparison.TestSites (1)
StartupNtlmAuthentication.cs (1)
35catch (Exception ex)
Shared (2)
Throw\Throw.cs (2)
385public static void ArgumentException(string paramName, string? message, Exception? innerException) 408public static void InvalidOperationException(string message, Exception? innerException)
Shared.Tests (104)
Throw\DoubleTests.cs (17)
30var exception = Record.Exception(() => Throw.IfLessThan(0.0, 0.0, "paramName")); 49var exception = Record.Exception(() => Throw.IfGreaterThan(0.0, 0.0, "paramName")); 68var exception = Record.Exception(() => Throw.IfLessThanOrEqual(1.5, 0.0, "paramName")); 87var exception = Record.Exception(() => Throw.IfGreaterThanOrEqual(0.0, 1.3, "paramName")); 108var exception = Record.Exception(() => Throw.IfZero(notZero, "paramName")); 136var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1)); 137var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1, nameof(Zero))); 147var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1)); 148var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1, nameof(Zero))); 158var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1)); 159var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1, nameof(Zero))); 169var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1)); 170var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1, nameof(Zero))); 180var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero)); 181var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero, nameof(Zero))); 191var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2)); 192var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2, nameof(Zero)));
Throw\IntegerTests.cs (34)
26var exception = Record.Exception(() => Throw.IfLessThan(0, 0, "paramName")); 41var exception = Record.Exception(() => Throw.IfGreaterThan(0, 0, "paramName")); 56var exception = Record.Exception(() => Throw.IfLessThanOrEqual(1, 0, "paramName")); 71var exception = Record.Exception(() => Throw.IfGreaterThanOrEqual(0, 1, "paramName")); 86var exception = Record.Exception(() => Throw.IfZero(1, "paramName")); 110var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1)); 111var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1, nameof(Zero))); 121var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1)); 122var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1, nameof(Zero))); 132var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1)); 133var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1, nameof(Zero))); 143var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1)); 144var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1, nameof(Zero))); 154var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero)); 155var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero, nameof(Zero))); 165var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2)); 166var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2, nameof(Zero))); 186var exception = Record.Exception(() => Throw.IfLessThan(0U, 0U, "paramName")); 201var exception = Record.Exception(() => Throw.IfGreaterThan(0U, 0U, "paramName")); 216var exception = Record.Exception(() => Throw.IfLessThanOrEqual(1U, 0U, "paramName")); 231var exception = Record.Exception(() => Throw.IfGreaterThanOrEqual(0U, 1U, "paramName")); 246var exception = Record.Exception(() => Throw.IfZero(1U, "paramName")); 270var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(One, 0U)); 271var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(One, 0U, nameof(One))); 281var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(One, 0U)); 282var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(One, 0U, nameof(One))); 292var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1U)); 293var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1U, nameof(Zero))); 303var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1U)); 304var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1U, nameof(Zero))); 314var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero)); 315var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero, nameof(Zero))); 325var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1U, 2U)); 326var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1U, 2U, nameof(Zero)));
Throw\LongTests.cs (34)
26var exception = Record.Exception(() => Throw.IfLessThan(0L, 0L, "paramName")); 41var exception = Record.Exception(() => Throw.IfGreaterThan(0L, 0L, "paramName")); 56var exception = Record.Exception(() => Throw.IfLessThanOrEqual(1L, 0L, "paramName")); 71var exception = Record.Exception(() => Throw.IfGreaterThanOrEqual(0L, 1L, "paramName")); 86var exception = Record.Exception(() => Throw.IfZero(1L, "paramName")); 110var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1)); 111var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(Zero, -1, nameof(Zero))); 121var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1)); 122var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(Zero, -1, nameof(Zero))); 132var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1)); 133var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1, nameof(Zero))); 143var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1)); 144var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1, nameof(Zero))); 154var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero)); 155var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero, nameof(Zero))); 165var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2)); 166var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1, 2, nameof(Zero))); 186var exception = Record.Exception(() => Throw.IfLessThan(0UL, 0UL, "paramName")); 201var exception = Record.Exception(() => Throw.IfGreaterThan(0UL, 0UL, "paramName")); 216var exception = Record.Exception(() => Throw.IfLessThanOrEqual(1UL, 0UL, "paramName")); 231var exception = Record.Exception(() => Throw.IfGreaterThanOrEqual(0UL, 1UL, "paramName")); 246var exception = Record.Exception(() => Throw.IfZero(1UL, "paramName")); 270var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(One, 0UL)); 271var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThan(One, 0UL, nameof(One))); 281var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(One, 0UL)); 282var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfGreaterThanOrEqual(One, 0UL, nameof(One))); 292var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1UL)); 293var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThan(Zero, 1UL, nameof(Zero))); 303var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1UL)); 304var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfLessThanOrEqual(Zero, 1UL, nameof(Zero))); 314var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero)); 315var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfZero(Zero, nameof(Zero))); 325var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1UL, 2UL)); 326var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange(Zero, 1UL, 2UL, nameof(Zero)));
Throw\ThrowTest.cs (19)
29var innerException = new Exception(); 52var innerException = new Exception(); 146var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNull(somethingThatIsNull)); 147var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfNull(somethingThatIsNull, nameof(somethingThatIsNull))); 159var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNullOrMemberNull(somethingThatIsNull, somethingNestedThatIsNull)); 160var exceptionExplicitArgumentName = Record.Exception( 173var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNullOrMemberNull(red, somethingNestedThatIsNull)); 174var exceptionExplicitArgumentName = Record.Exception( 208var exception = Record.Exception(() => Throw.IfNullOrMemberNull(red, blue)); 239var exception = Record.Exception(() => Throw.IfNullOrWhitespace("param", "paramName")); 261var exception = Record.Exception(() => Throw.IfNullOrEmpty("param", "paramName")); 270var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNullOrWhitespace(somethingThatIsNull)); 271var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfNullOrWhitespace(somethingThatIsNull, nameof(somethingThatIsNull))); 281var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNullOrEmpty(somethingThatIsNull)); 282var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfNullOrEmpty(somethingThatIsNull, nameof(somethingThatIsNull))); 302var exception = Record.Exception(() => Throw.IfBufferTooSmall(23, 23, "paramName")); 380var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfNullOrEmpty(listButActuallyNull!)); 417var exceptionImplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange((Color)colorButNull!)); 418var exceptionExplicitArgumentName = Record.Exception(() => Throw.IfOutOfRange((Color)colorButNull!, nameof(colorButNull)));
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
253catch (Exception ex)
SignalRSamples (3)
Hubs\Chat.cs (1)
16public override Task OnDisconnectedAsync(Exception exception)
Hubs\DynamicChat.cs (1)
16public override Task OnDisconnectedAsync(Exception exception)
Hubs\HubTChat.cs (1)
16public override Task OnDisconnectedAsync(Exception exception)
Sockets.BindTests (5)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (2)
273var errors = new List<Exception>(); 287catch (Exception ex)
Sockets.FunctionalTests (14)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (2)
52public override void Complete(Exception exception = null) => _output.Complete(exception); 76public override void Complete(Exception exception = null) => _input.Complete(exception);
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
64public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) 121public Exception Exception { get; set; }
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (2)
112public override void Complete(Exception exception = null) 147public override void Complete(Exception exception = null)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
881catch (Exception ex) 1061catch (Exception ex)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (5)
164catch (Exception ex) 223catch (Exception ex) 313catch (Exception ex) 547catch (Exception ex) 789catch (Exception ex)
Stress.AppHost (1)
ResourceBuilderExtensions.cs (1)
69catch (Exception ex)
System.CodeDom (1)
System\CodeDom\CodeCatchClause.cs (1)
40get => _catchExceptionType ??= new CodeTypeReference(typeof(Exception));
System.ComponentModel.Annotations (3)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\ComponentModel\DataAnnotations\ValidationException.cs (1)
68public ValidationException(string? message, Exception? innerException)
System.ComponentModel.Composition (84)
Microsoft\Internal\GenerationServices.cs (1)
37private static readonly MethodInfo ExceptionGetData = typeof(Exception).GetProperty("Data")!.GetGetMethod()!;
System\ComponentModel\Composition\ChangeRejectedException.cs (4)
19: this((string?)null, (Exception?)null) 27: this(message, (Exception?)null) 34public ChangeRejectedException(string? message, Exception? innerException) 44: base((string?)null, (Exception?)null, errors)
System\ComponentModel\Composition\CompositionContractMismatchException.cs (7)
21: this((string?)null, (Exception?)null) 32/// the <see cref="Exception.Message"/> property to its default value. 35: this(message, (Exception?)null) 47/// the <see cref="Exception.Message"/> property to its default value. 50/// The <see cref="Exception"/> that is the underlying cause of the 52/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 54public CompositionContractMismatchException(string? message, Exception? innerException)
System\ComponentModel\Composition\CompositionError.cs (11)
18private readonly Exception? _exception; 32: this(CompositionErrorId.Unknown, message, (ICompositionElement?)null, (Exception?)null) 53: this(CompositionErrorId.Unknown, message, element, (Exception?)null) 72public CompositionError(string? message, Exception? exception) 98public CompositionError(string? message, ICompositionElement? element, Exception? exception) 103internal CompositionError(CompositionErrorId id, string? description, ICompositionElement? element, Exception? exception) 142public Exception? Exception 152internal Exception? InnerException 170return Create(id, (ICompositionElement?)null, (Exception?)null, format, parameters); 175return Create(id, element, (Exception?)null, format, parameters); 178internal static CompositionError Create(CompositionErrorId id, ICompositionElement? element, Exception? exception, string format, params object?[] parameters)
System\ComponentModel\Composition\CompositionErrorDebuggerProxy.cs (1)
25public Exception? Exception
System\ComponentModel\Composition\CompositionException.cs (13)
30: this((string?)null, (Exception?)null, (IEnumerable<CompositionError>?)null) 41/// the <see cref="Exception.Message"/> property to its default value. 44: this(message, (Exception?)null, (IEnumerable<CompositionError>?)null) 56/// the <see cref="Exception.Message"/> property to its default value. 59/// The <see cref="Exception"/> that is the underlying cause of the 61/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 63public CompositionException(string? message, Exception? innerException) 87: this((string?)null, (Exception?)null, errors) 91internal CompositionException(string? message, Exception? innerException, IEnumerable<CompositionError>? errors) 134public ReadOnlyCollection<Exception> RootCauses 138var errors = new List<Exception>(); 156return errors.ToReadOnlyCollection<Exception>(); 311private static void VisitException(Exception exception, VisitContext context)
System\ComponentModel\Composition\CompositionExceptionDebuggerProxy.cs (4)
23public ReadOnlyCollection<Exception> Exceptions 27var errors = new List<Exception>(); 37return errors.ToReadOnlyCollection<Exception>(); 46public ReadOnlyCollection<Exception> RootCauses
System\ComponentModel\Composition\ErrorBuilder.cs (4)
44(Exception?)null); 47public static CompositionError CreatePartCannotActivate(ComposablePart part, Exception innerException) 61public static CompositionError CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException) 77public static CompositionError CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException)
System\ComponentModel\Composition\ExceptionBuilder.cs (2)
12public static Exception CreateDiscoveryException(string messageFormat, params string[] arguments) 78public static CompositionException CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException)
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (6)
151List<Exception>? exceptions = null; 167catch (Exception e) 172exceptions ??= new List<Exception>(); 190List<Exception>? exceptions = null; 203catch (Exception e) 207exceptions ??= new List<Exception>();
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (1)
663Exception? exception;
System\ComponentModel\Composition\ImportCardinalityMismatchException.cs (7)
24: this((string?)null, (Exception?)null) 35/// the <see cref="Exception.Message"/> property to its default value. 38: this(message, (Exception?)null) 50/// the <see cref="Exception.Message"/> property to its default value. 53/// The <see cref="Exception"/> that is the underlying cause of the 55/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 57public ImportCardinalityMismatchException(string? message, Exception? innerException)
System\ComponentModel\Composition\ImportCardinalityMismatchExceptionDebuggerProxy.cs (1)
19public Exception? InnerException
System\ComponentModel\Composition\MetadataViewGenerator.cs (2)
146catch (Exception e) 200LocalBuilder exception = proxyCtorIL.DeclareLocal(typeof(Exception));
System\ComponentModel\Composition\Primitives\ComposablePartException.cs (13)
25: this((string?)null, (ICompositionElement?)null, (Exception?)null) 66/// the <see cref="Exception.Message"/> property to its default value. 69: this(message, (ICompositionElement?)null, (Exception?)null) 81/// the <see cref="Exception.Message"/> property to its default value. 90: this(message, element, (Exception?)null) 102/// the <see cref="Exception.Message"/> property to its default value. 105/// The <see cref="Exception"/> that is the underlying cause of the 107/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 109public ComposablePartException(string? message, Exception? innerException) 122/// the <see cref="Exception.Message"/> property to its default value. 131/// The <see cref="Exception"/> that is the underlying cause of the 133/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 135public ComposablePartException(string? message, ICompositionElement? element, Exception? innerException)
System\ComponentModel\Composition\Primitives\ComposablePartExceptionDebuggerProxy.cs (1)
24public Exception? InnerException
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (3)
192catch (Exception exception) 222catch (Exception exception) 239catch (Exception exception)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
417Exception? exception = null; 547catch (Exception exception)
System\Composition\Diagnostics\CompositionTrace.cs (1)
41internal static void AssemblyLoadFailed(DirectoryCatalog catalog, string fileName, Exception exception)
System.ComponentModel.EventBasedAsync (5)
System\ComponentModel\AsyncCompletedEvent.cs (2)
12public AsyncCompletedEventArgs(Exception? error, bool cancelled, object? userState) 32public Exception? Error { get; }
System\ComponentModel\BackgroundWorker.cs (2)
170Exception? error = null; 186catch (Exception exception)
System\ComponentModel\RunWorkerCompletedEvent.cs (1)
13Exception? error,
System.ComponentModel.Primitives (2)
System\ComponentModel\InvalidAsynchronousStateException.cs (1)
38public InvalidAsynchronousStateException(string? message, Exception? innerException) : base(message, innerException)
System\ComponentModel\InvalidEnumArgumentException.cs (1)
37public InvalidEnumArgumentException(string? message, Exception? innerException)
System.ComponentModel.TypeConverter (14)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
110catch (Exception e)
System\ComponentModel\BaseNumberConverter.cs (1)
78catch (Exception e)
System\ComponentModel\Design\CheckoutException.cs (1)
65public CheckoutException(string? message, Exception? innerException) : base(message, innerException)
System\ComponentModel\EnumConverter.cs (1)
102catch (Exception e)
System\ComponentModel\LicenseException.cs (1)
51public LicenseException(Type? type, object? instance, string? message, Exception? innerException) : base(message, innerException)
System\ComponentModel\MemberDescriptor.cs (1)
336catch (Exception)
System\ComponentModel\ReflectPropertyDescriptor.cs (3)
105catch (Exception t) 921catch (Exception t) 1124catch (Exception t)
System\ComponentModel\ToolboxItemAttribute.cs (1)
91catch (Exception ex)
System\ComponentModel\TypeConverter.cs (2)
192protected Exception GetConvertFromException(object? value) 202protected Exception GetConvertToException(object? value, Type destinationType)
System\ComponentModel\VersionConverter.cs (1)
48catch (Exception e)
System\ComponentModel\WarningException.cs (1)
45public WarningException(string? message, Exception? innerException) : base(message, innerException)
System.Composition.Runtime (1)
System\Composition\Hosting\CompositionFailedException.cs (1)
33public CompositionFailedException(string message, Exception innerException)
System.Configuration.ConfigurationManager (56)
System\Configuration\AppSettingsReader.cs (1)
75catch (Exception)
System\Configuration\BaseConfigurationRecord.cs (12)
519catch (Exception e) 597catch (Exception e) 735catch (Exception e) 1212Exception savedException = null; 1286catch (Exception e) 1353catch (Exception e) 1585catch (Exception e) 1635catch (Exception e) 1737catch (Exception e) 2603catch (Exception e) 3036catch (Exception e) 3614catch (Exception e)
System\Configuration\ClientConfigurationSystem.cs (3)
18private Exception _initError; 160catch (Exception e) 216catch (Exception ex)
System\Configuration\ConfigurationElement.cs (1)
1778catch (Exception ex)
System\Configuration\ConfigurationErrorsException.cs (5)
35public ConfigurationErrorsException(string message, Exception inner, string filename, int line) 50public ConfigurationErrorsException(string message, Exception inner) : 62public ConfigurationErrorsException(string message, Exception inner, XmlNode node) : 70public ConfigurationErrorsException(string message, Exception inner, XmlReader reader) : 78internal ConfigurationErrorsException(string message, Exception inner, IConfigErrorInfo errorInfo) :
System\Configuration\ConfigurationException.cs (3)
44public ConfigurationException(string message, Exception inner) : this(message, inner, null, 0) { } 52public ConfigurationException(string message, Exception inner, XmlNode node) 60public ConfigurationException(string message, Exception inner, string filename, int line) : base(message, inner)
System\Configuration\ConfigurationManager.cs (3)
17private static volatile Exception s_initError; 106catch (Exception e) 122internal static void SetInitError(Exception initError)
System\Configuration\ConfigurationProperty.cs (4)
307catch (Exception ex) 338catch (Exception ex) 361catch (Exception ex) 374catch (Exception ex)
System\Configuration\ExceptionUtil.cs (2)
38internal static ConfigurationErrorsException WrapAsConfigException(string outerMessage, Exception e, 46internal static ConfigurationErrorsException WrapAsConfigException(string outerMessage, Exception e,
System\Configuration\HandlerBase.cs (2)
50catch (Exception e) 82catch (Exception e)
System\Configuration\Internal\InternalConfigHost.cs (1)
267catch (Exception e)
System\Configuration\MgmtConfigurationRecord.cs (8)
268catch (Exception e) 414catch (Exception e) 485catch (Exception e) 1092catch (Exception e) 1674catch (Exception e) 1694catch (Exception e) 1882catch (Exception e) 3045catch (Exception e)
System\Configuration\Provider\ProviderException.cs (1)
19public ProviderException(string message, Exception innerException)
System\Configuration\RuntimeConfigurationRecord.cs (1)
71catch (Exception e)
System\Configuration\SettingsPropertyIsReadOnlyException.cs (1)
18public SettingsPropertyIsReadOnlyException(string message, Exception innerException)
System\Configuration\SettingsPropertyNotFoundException.cs (1)
18public SettingsPropertyNotFoundException(string message, Exception innerException)
System\Configuration\SettingsPropertyValue.cs (3)
109catch (Exception) 143catch (Exception e) 278catch (Exception)
System\Configuration\SettingsPropertyValueCollection.cs (1)
31catch (Exception)
System\Configuration\SettingsPropertyWrongTypeException.cs (1)
18public SettingsPropertyWrongTypeException(string message, Exception innerException)
System\Diagnostics\TraceUtils.cs (2)
48Exception innerException = null; 115catch (Exception e)
System.Console (8)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System\IO\Error.cs (4)
8internal static Exception GetFileNotOpen() 13internal static Exception GetReadNotSupported() 18internal static Exception GetSeekNotSupported() 23internal static Exception GetWriteNotSupported()
System.Data.Common (515)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (16)
31static partial void TraceException(string trace, Exception e); 33internal static void TraceExceptionAsReturnValue(Exception e) 38internal static void TraceExceptionWithoutRethrow(Exception e) 51internal static ArgumentException Argument(string error, Exception? inner) 105internal static InvalidCastException InvalidCast(string error, Exception? inner) 240internal static bool IsCatchableExceptionType(Exception e) 254internal static bool IsCatchableOrSecurityExceptionType(Exception e) 290internal static ArgumentException ConvertFailed(Type fromType, Type toType, Exception? innerException) 298internal static Exception InvalidConnectionOptionValue(string key) 302internal static Exception InvalidConnectionOptionValue(string key, Exception? inner) 357internal static Exception StreamClosed([CallerMemberName] string method = "") 446internal static Exception InternalError(InternalErrorCode internalError) 454internal static Exception DataReaderClosed([CallerMemberName] string method = "") 470internal static Exception InvalidDataLength(long length) 492internal static Exception InvalidSeekOrigin(string parameterName)
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
493private static void ParseComparison(Dictionary<string, string?> parsetable, string connectionString, Dictionary<string, string>? synonyms, bool firstKey, Exception? e)
System\Data\Common\AdapterUtil.Common.cs (29)
25static partial void TraceException(string trace, Exception e) 34internal static void TraceExceptionForCapture(Exception e) 278internal static Exception WrongType(Type got, Type expected) 286internal static Exception CollectionUniqueValue(Type itemType, string propertyName, string? propertyValue) 354internal static Exception InvalidSourceColumn(string parameter) 358internal static Exception ColumnsAddNullAttempt(string parameter) 362internal static Exception ColumnsDataSetColumn(string cacheColumn) 366internal static Exception ColumnsIndexInt32(int index, IColumnMappingCollection collection) 370internal static Exception ColumnsIndexSource(string srcColumn) 374internal static Exception ColumnsIsNotParent(ICollection collection) 378internal static Exception ColumnsIsParent(ICollection collection) 382internal static Exception ColumnsUniqueSourceColumn(string? srcColumn) 386internal static Exception NotADataColumnMapping(object value) 394internal static Exception InvalidSourceTable(string parameter) 398internal static Exception TablesAddNullAttempt(string parameter) 402internal static Exception TablesDataSetTable(string cacheTable) 406internal static Exception TablesIndexInt32(int index, ITableMappingCollection collection) 410internal static Exception TablesIsNotParent(ICollection collection) 414internal static Exception TablesIsParent(ICollection collection) 418internal static Exception TablesSourceIndex(string srcTable) 422internal static Exception TablesUniqueSourceTable(string? srcTable) 426internal static Exception NotADataTableMapping(object value) 519internal static Exception FillSchemaRequiresSourceTableName(string parameter) 527internal static Exception InvalidMaxRecords(string parameter, int max) 531internal static Exception InvalidStartRecord(string parameter, int start) 535internal static Exception FillRequires(string parameter) 539internal static Exception FillRequiresSourceTableName(string parameter) 543internal static Exception FillChapterAutoIncrement() 575internal static Exception UpdateConcurrencyViolation(StatementType statementType, int affected, int expected, DataRow[] dataRows)
System\Data\Common\DataAdapter.cs (5)
605catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 642catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 685catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 709catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 744private void OnFillErrorHandler(Exception e, DataTable? dataTable, object?[]? dataValues)
System\Data\Common\DataRecordInternal.cs (2)
142catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 218catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\Common\DbCommand.cs (5)
94catch (Exception) 139catch (Exception e) 180catch (Exception e) 212catch (Exception e) 239catch (Exception e)
System\Data\Common\DBCommandBuilder.cs (1)
1589catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\Common\DbConnection.cs (7)
78catch (Exception e) 99catch (Exception e) 125catch (Exception e) 240catch (Exception e) 272catch (Exception e) 304catch (Exception e) 337catch (Exception e)
System\Data\Common\DbDataAdapter.cs (12)
31internal Exception? _errors; 678protected virtual bool GetBatchedRecordsAffected(int commandIdentifier, out int recordsAffected, out Exception? error) 1058catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 1122Exception? errors = null; 1160catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 1240catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 1251Exception? errors = rowUpdatedEvent.Errors; 1320catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 1327Exception? errors = rowUpdatedEvent.Errors; 1655Exception? errors = rowUpdatedEvent.Errors; 1672if (batchCommands[i]._errors is Exception commandErrors) 1725Exception? errors = rowUpdatedEvent.Errors;
System\Data\Common\DbDataReader.cs (7)
43catch (Exception e) 114catch (Exception e) 144catch (Exception e) 262catch (Exception e) 287catch (Exception e) 312catch (Exception e) 333catch (Exception e)
System\Data\Common\DbDataSource.cs (12)
123catch (Exception e) 150catch (Exception e) 176catch (Exception e) 203catch (Exception e) 229catch (Exception e) 259catch (Exception e) 382catch (Exception e) 409catch (Exception e) 435catch (Exception e) 462catch (Exception e) 488catch (Exception e) 518catch (Exception e)
System\Data\Common\DbException.cs (1)
16protected DbException(string? message, System.Exception? innerException) : base(message, innerException) { }
System\Data\Common\DbTransaction.cs (5)
35catch (Exception e) 65catch (Exception e) 106catch (Exception e) 132catch (Exception e) 159catch (Exception e)
System\Data\Common\RowUpdatedEventArgs.cs (2)
15private Exception? _errors; 50public Exception? Errors
System\Data\Common\RowUpdatingEventArgs.cs (2)
11private Exception? _errors; 50public Exception? Errors
System\Data\Constraint.cs (1)
119catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e))
System\Data\ConstraintCollection.cs (1)
451catch (Exception e) when (Common.ADP.IsCatchableOrSecurityExceptionType(e))
System\Data\DataColumn.cs (4)
796catch (Exception e1) when (ADP.IsCatchableExceptionType(e1)) 818catch (Exception e2) when (ADP.IsCatchableExceptionType(e2)) 1144catch (Exception e) 1186catch (Exception e)
System\Data\DataColumnCollection.cs (2)
363catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e)) 608catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e))
System\Data\DataException.cs (304)
31public DataException(string? s, Exception? innerException) : base(s ?? SR.DataSet_DefaultDataException, innerException) { } 54public ConstraintException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultConstraintException, innerException) 86public DeletedRowInaccessibleException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultDeletedRowInaccessibleException, innerException) 112public DuplicateNameException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultDuplicateNameException, innerException) 138public InRowChangingEventException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultInRowChangingEventException, innerException) 164public InvalidConstraintException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultInvalidConstraintException, innerException) 190public MissingPrimaryKeyException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultMissingPrimaryKeyException, innerException) 216public NoNullAllowedException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultNoNullAllowedException, innerException) 242public ReadOnlyException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultReadOnlyException, innerException) 268public RowNotInTableException(string? message, Exception? innerException) : base(message ?? SR.DataSet_DefaultRowNotInTableException, innerException) 294public VersionNotFoundException(string? message, Exception? innerException) : base(message ?? (SR.DataSet_DefaultVersionNotFoundException), innerException) 311private static void TraceException(string trace, Exception e) 320internal static Exception TraceExceptionAsReturnValue(Exception e) 326internal static Exception TraceExceptionForCapture(Exception e) 332internal static Exception TraceExceptionWithoutRethrow(Exception e) 338internal static Exception _Argument(string error) => TraceExceptionAsReturnValue(new ArgumentException(error)); 339internal static Exception _Argument(string error, Exception? innerException) => TraceExceptionAsReturnValue(new ArgumentException(error, innerException)); 340private static Exception _ArgumentNull(string paramName, string msg) => TraceExceptionAsReturnValue(new ArgumentNullException(paramName, msg)); 341internal static Exception _ArgumentOutOfRange(string paramName, string msg) => TraceExceptionAsReturnValue(new ArgumentOutOfRangeException(paramName, msg)); 342private static Exception _IndexOutOfRange(string error) => TraceExceptionAsReturnValue(new IndexOutOfRangeException(error)); 343private static Exception _InvalidOperation(string error) => TraceExceptionAsReturnValue(new InvalidOperationException(error)); 344private static Exception _InvalidEnumArgumentException(string error) => TraceExceptionAsReturnValue(new InvalidEnumArgumentException(error)); 345private static Exception _InvalidEnumArgumentException<T>(T value) where T : Enum 352private static void ThrowDataException(string error, Exception? innerException) 357private static Exception _Data(string error) => TraceExceptionAsReturnValue(new DataException(error)); 358private static Exception _Constraint(string error) => TraceExceptionAsReturnValue(new ConstraintException(error)); 359private static Exception _InvalidConstraint(string error) => TraceExceptionAsReturnValue(new InvalidConstraintException(error)); 360private static Exception _DeletedRowInaccessible(string error) => TraceExceptionAsReturnValue(new DeletedRowInaccessibleException(error)); 361private static Exception _DuplicateName(string error) => TraceExceptionAsReturnValue(new DuplicateNameException(error)); 362private static Exception _InRowChangingEvent(string error) => TraceExceptionAsReturnValue(new InRowChangingEventException(error)); 363private static Exception _MissingPrimaryKey(string error) => TraceExceptionAsReturnValue(new MissingPrimaryKeyException(error)); 364private static Exception _NoNullAllowed(string error) => TraceExceptionAsReturnValue(new NoNullAllowedException(error)); 366private static Exception _ReadOnly(string error) => TraceExceptionAsReturnValue(new ReadOnlyException(error)); 367private static Exception _RowNotInTable(string error) => TraceExceptionAsReturnValue(new RowNotInTableException(error)); 368private static Exception _VersionNotFound(string error) => TraceExceptionAsReturnValue(new VersionNotFoundException(error)); 370public static Exception ArgumentNull(string paramName) => _ArgumentNull(paramName, SR.Format(SR.Data_ArgumentNull, paramName)); 371public static Exception ArgumentOutOfRange(string paramName) => _ArgumentOutOfRange(paramName, SR.Format(SR.Data_ArgumentOutOfRange, paramName)); 372public static Exception BadObjectPropertyAccess(string error) => _InvalidOperation(SR.Format(SR.DataConstraint_BadObjectPropertyAccess, error)); 373public static Exception ArgumentContainsNull(string paramName) => TraceExceptionAsReturnValue(new ArgumentException(SR.Data_ArgumentContainsNull, paramName)); 374public static Exception TypeNotAllowed(Type type) => _InvalidOperation(SR.Format(SR.Data_TypeNotAllowed, type.AssemblyQualifiedName)); 380public static Exception NotSupportedOnDataSourceBatch() => Common.ADP.NotSupported(SR.Batch_NotSupportedOnDataSourceBatch); 386public static Exception NotSupportedOnDataSourceCommand() => Common.ADP.NotSupported(SR.Command_NotSupportedOnDataSourceCommand); 392public static Exception CannotModifyCollection() => _Argument(SR.Data_CannotModifyCollection); 393public static Exception CaseInsensitiveNameConflict(string? name) => _Argument(SR.Format(SR.Data_CaseInsensitiveNameConflict, name)); 394public static Exception NamespaceNameConflict(string? name) => _Argument(SR.Format(SR.Data_NamespaceNameConflict, name)); 395public static Exception InvalidOffsetLength() => _Argument(SR.Data_InvalidOffsetLength); 401public static Exception ColumnNotInTheTable(string column, string table) => _Argument(SR.Format(SR.DataColumn_NotInTheTable, column, table)); 402public static Exception ColumnNotInAnyTable() => _Argument(SR.DataColumn_NotInAnyTable); 403public static Exception ColumnOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataColumns_OutOfRange, (index).ToString(CultureInfo.InvariantCulture))); 404public static Exception ColumnOutOfRange(string column) => _IndexOutOfRange(SR.Format(SR.DataColumns_OutOfRange, column)); 405public static Exception CannotAddColumn1(string column) => _Argument(SR.Format(SR.DataColumns_Add1, column)); 406public static Exception CannotAddColumn2(string column) => _Argument(SR.Format(SR.DataColumns_Add2, column)); 407public static Exception CannotAddColumn3() => _Argument(SR.DataColumns_Add3); 408public static Exception CannotAddColumn4(string column) => _Argument(SR.Format(SR.DataColumns_Add4, column)); 409public static Exception CannotAddDuplicate(string column) => _DuplicateName(SR.Format(SR.DataColumns_AddDuplicate, column)); 410public static Exception CannotAddDuplicate2(string table) => _DuplicateName(SR.Format(SR.DataColumns_AddDuplicate2, table)); 411public static Exception CannotAddDuplicate3(string table) => _DuplicateName(SR.Format(SR.DataColumns_AddDuplicate3, table)); 412public static Exception CannotRemoveColumn() => _Argument(SR.DataColumns_Remove); 413public static Exception CannotRemovePrimaryKey() => _Argument(SR.DataColumns_RemovePrimaryKey); 414public static Exception CannotRemoveChildKey(string relation) => _Argument(SR.Format(SR.DataColumns_RemoveChildKey, relation)); 415public static Exception CannotRemoveConstraint(string constraint, string table) => _Argument(SR.Format(SR.DataColumns_RemoveConstraint, constraint, table)); 416public static Exception CannotRemoveExpression(string column, string expression) => _Argument(SR.Format(SR.DataColumns_RemoveExpression, column, expression)); 417public static Exception ColumnNotInTheUnderlyingTable(string column, string table) => _Argument(SR.Format(SR.DataColumn_NotInTheUnderlyingTable, column, table)); 418public static Exception InvalidOrdinal(string name, int ordinal) => _ArgumentOutOfRange(name, SR.Format(SR.DataColumn_OrdinalExceedMaximum, (ordinal).ToString(CultureInfo.InvariantCulture))); 424public static Exception AddPrimaryKeyConstraint() => _Argument(SR.DataConstraint_AddPrimaryKeyConstraint); 425public static Exception NoConstraintName() => _Argument(SR.DataConstraint_NoName); 426public static Exception ConstraintViolation(string constraint) => _Constraint(SR.Format(SR.DataConstraint_Violation, constraint)); 427public static Exception ConstraintNotInTheTable(string constraint) => _Argument(SR.Format(SR.DataConstraint_NotInTheTable, constraint)); 456public static Exception ConstraintViolation(DataColumn[] columns, object[] values) => _Constraint(UniqueConstraintViolationText(columns, values)); 457public static Exception ConstraintOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataConstraint_OutOfRange, (index).ToString(CultureInfo.InvariantCulture))); 458public static Exception DuplicateConstraint(string constraint) => _Data(SR.Format(SR.DataConstraint_Duplicate, constraint)); 459public static Exception DuplicateConstraintName(string constraint) => _DuplicateName(SR.Format(SR.DataConstraint_DuplicateName, constraint)); 460public static Exception NeededForForeignKeyConstraint(UniqueConstraint key, ForeignKeyConstraint fk) => _Argument(SR.Format(SR.DataConstraint_NeededForForeignKeyConstraint, key.ConstraintName, fk.ConstraintName)); 461public static Exception UniqueConstraintViolation() => _Argument(SR.DataConstraint_UniqueViolation); 462public static Exception ConstraintForeignTable() => _Argument(SR.DataConstraint_ForeignTable); 463public static Exception ConstraintParentValues() => _Argument(SR.DataConstraint_ParentValues); 464public static Exception ConstraintAddFailed(DataTable table) => _InvalidConstraint(SR.Format(SR.DataConstraint_AddFailed, table.TableName)); 465public static Exception ConstraintRemoveFailed() => _Argument(SR.DataConstraint_RemoveFailed); 466public static Exception FailedCascadeDelete(string constraint) => _InvalidConstraint(SR.Format(SR.DataConstraint_CascadeDelete, constraint)); 467public static Exception FailedCascadeUpdate(string constraint) => _InvalidConstraint(SR.Format(SR.DataConstraint_CascadeUpdate, constraint)); 468public static Exception FailedClearParentTable(string table, string constraint, string childTable) => _InvalidConstraint(SR.Format(SR.DataConstraint_ClearParentTable, table, constraint, childTable)); 469public static Exception ForeignKeyViolation(string constraint, object[] keys) => _InvalidConstraint(SR.Format(SR.DataConstraint_ForeignKeyViolation, constraint, KeysToString(keys))); 470public static Exception RemoveParentRow(ForeignKeyConstraint constraint) => _InvalidConstraint(SR.Format(SR.DataConstraint_RemoveParentRow, constraint.ConstraintName)); 473public static Exception CantAddConstraintToMultipleNestedTable(string tableName) => _Argument(SR.Format(SR.DataConstraint_CantAddConstraintToMultipleNestedTable, tableName)); 479public static Exception AutoIncrementAndExpression() => _Argument(SR.DataColumn_AutoIncrementAndExpression); 480public static Exception AutoIncrementAndDefaultValue() => _Argument(SR.DataColumn_AutoIncrementAndDefaultValue); 481public static Exception AutoIncrementSeed() => _Argument(SR.DataColumn_AutoIncrementSeed); 482public static Exception CantChangeDataType() => _Argument(SR.DataColumn_ChangeDataType); 483public static Exception NullDataType() => _Argument(SR.DataColumn_NullDataType); 484public static Exception ColumnNameRequired() => _Argument(SR.DataColumn_NameRequired); 485public static Exception DefaultValueAndAutoIncrement() => _Argument(SR.DataColumn_DefaultValueAndAutoIncrement); 486public static Exception DefaultValueDataType(string column, Type defaultType, Type columnType, Exception inner) => 491public static Exception DefaultValueColumnDataType(string column, Type defaultType, Type columnType, Exception inner) => _Argument(SR.Format(SR.DataColumn_DefaultValueColumnDataType, column, defaultType.FullName, columnType.FullName), inner); 492public static Exception ExpressionAndUnique() => _Argument(SR.DataColumn_ExpressionAndUnique); 493public static Exception ExpressionAndReadOnly() => _Argument(SR.DataColumn_ExpressionAndReadOnly); 494public static Exception ExpressionAndConstraint(DataColumn column, Constraint constraint) => _Argument(SR.Format(SR.DataColumn_ExpressionAndConstraint, column.ColumnName, constraint.ConstraintName)); 495public static Exception ExpressionInConstraint(DataColumn column) => _Argument(SR.Format(SR.DataColumn_ExpressionInConstraint, column.ColumnName)); 496public static Exception ExpressionCircular() => _Argument(SR.DataColumn_ExpressionCircular); 497public static Exception NonUniqueValues(string column) => _InvalidConstraint(SR.Format(SR.DataColumn_NonUniqueValues, column)); 498public static Exception NullKeyValues(string column) => _Data(SR.Format(SR.DataColumn_NullKeyValues, column)); 499public static Exception NullValues(string column) => _NoNullAllowed(SR.Format(SR.DataColumn_NullValues, column)); 500public static Exception ReadOnlyAndExpression() => _ReadOnly(SR.DataColumn_ReadOnlyAndExpression); 501public static Exception ReadOnly(string column) => _ReadOnly(SR.Format(SR.DataColumn_ReadOnly, column)); 502public static Exception UniqueAndExpression() => _Argument(SR.DataColumn_UniqueAndExpression); 503public static Exception SetFailed(object? value, DataColumn column, Type type, Exception innerException) => _Argument(innerException.Message + SR.Format(SR.DataColumn_SetFailed, value?.ToString(), column.ColumnName, type.Name), innerException); 504public static Exception CannotSetToNull(DataColumn column) => _Argument(SR.Format(SR.DataColumn_CannotSetToNull, column.ColumnName)); 505public static Exception LongerThanMaxLength(DataColumn column) => _Argument(SR.Format(SR.DataColumn_LongerThanMaxLength, column.ColumnName)); 506public static Exception CannotSetMaxLength(DataColumn column, int value) => _Argument(SR.Format(SR.DataColumn_CannotSetMaxLength, column.ColumnName, value.ToString(CultureInfo.InvariantCulture))); 507public static Exception CannotSetMaxLength2(DataColumn column) => _Argument(SR.Format(SR.DataColumn_CannotSetMaxLength2, column.ColumnName)); 508public static Exception CannotSetSimpleContentType(string columnName, Type type) => _Argument(SR.Format(SR.DataColumn_CannotSimpleContentType, columnName, type)); 509public static Exception CannotSetSimpleContent(string columnName, Type type) => _Argument(SR.Format(SR.DataColumn_CannotSimpleContent, columnName, type)); 510public static Exception CannotChangeNamespace(string columnName) => _Argument(SR.Format(SR.DataColumn_CannotChangeNamespace, columnName)); 511public static Exception HasToBeStringType(DataColumn column) => _Argument(SR.Format(SR.DataColumn_HasToBeStringType, column.ColumnName)); 512public static Exception AutoIncrementCannotSetIfHasData(string typeName) => _Argument(SR.Format(SR.DataColumn_AutoIncrementCannotSetIfHasData, typeName)); 513public static Exception INullableUDTwithoutStaticNull(string typeName) => _Argument(SR.Format(SR.DataColumn_INullableUDTwithoutStaticNull, typeName)); 514public static Exception IComparableNotImplemented(string typeName) => _Data(SR.Format(SR.DataStorage_IComparableNotDefined, typeName)); 515public static Exception UDTImplementsIChangeTrackingButnotIRevertible(string typeName) => _InvalidOperation(SR.Format(SR.DataColumn_UDTImplementsIChangeTrackingButnotIRevertible, typeName)); 516public static Exception SetAddedAndModifiedCalledOnnonUnchanged() => _InvalidOperation(SR.DataColumn_SetAddedAndModifiedCalledOnNonUnchanged); 517public static Exception InvalidDataColumnMapping(Type type) => _Argument(SR.Format(SR.DataColumn_InvalidDataColumnMapping, type.AssemblyQualifiedName)); 518public static Exception CannotSetDateTimeModeForNonDateTimeColumns() => _InvalidOperation(SR.DataColumn_CannotSetDateTimeModeForNonDateTimeColumns); 519public static Exception InvalidDateTimeMode(DataSetDateTime mode) => _InvalidEnumArgumentException(mode); 520public static Exception CantChangeDateTimeMode(DataSetDateTime oldValue, DataSetDateTime newValue) => _InvalidOperation(SR.Format(SR.DataColumn_DateTimeMode, oldValue.ToString(), newValue.ToString())); 521public static Exception ColumnTypeNotSupported() => Common.ADP.NotSupported(SR.DataColumn_NullableTypesNotSupported); 527public static Exception SetFailed(string name) => _Data(SR.Format(SR.DataView_SetFailed, name)); 528public static Exception SetDataSetFailed() => _Data(SR.DataView_SetDataSetFailed); 529public static Exception SetRowStateFilter() => _Data(SR.DataView_SetRowStateFilter); 530public static Exception CanNotSetDataSet() => _Data(SR.DataView_CanNotSetDataSet); 531public static Exception CanNotUseDataViewManager() => _Data(SR.DataView_CanNotUseDataViewManager); 532public static Exception CanNotSetTable() => _Data(SR.DataView_CanNotSetTable); 533public static Exception CanNotUse() => _Data(SR.DataView_CanNotUse); 534public static Exception CanNotBindTable() => _Data(SR.DataView_CanNotBindTable); 535public static Exception SetTable() => _Data(SR.DataView_SetTable); 536public static Exception SetIListObject() => _Argument(SR.DataView_SetIListObject); 537public static Exception AddNewNotAllowNull() => _Data(SR.DataView_AddNewNotAllowNull); 538public static Exception NotOpen() => _Data(SR.DataView_NotOpen); 539public static Exception CreateChildView() => _Argument(SR.DataView_CreateChildView); 540public static Exception CanNotDelete() => _Data(SR.DataView_CanNotDelete); 541public static Exception CanNotEdit() => _Data(SR.DataView_CanNotEdit); 542public static Exception GetElementIndex(int index) => _IndexOutOfRange(SR.Format(SR.DataView_GetElementIndex, (index).ToString(CultureInfo.InvariantCulture))); 543public static Exception AddExternalObject() => _Argument(SR.DataView_AddExternalObject); 544public static Exception CanNotClear() => _Argument(SR.DataView_CanNotClear); 545public static Exception InsertExternalObject() => _Argument(SR.DataView_InsertExternalObject); 546public static Exception RemoveExternalObject() => _Argument(SR.DataView_RemoveExternalObject); 547public static Exception PropertyNotFound(string property, string table) => _Argument(SR.Format(SR.DataROWView_PropertyNotFound, property, table)); 548public static Exception ColumnToSortIsOutOfRange(string column) => _Argument(SR.Format(SR.DataColumns_OutOfRange, column)); 554public static Exception KeyTableMismatch() => _InvalidConstraint(SR.DataKey_TableMismatch); 555public static Exception KeyNoColumns() => _InvalidConstraint(SR.DataKey_NoColumns); 556public static Exception KeyTooManyColumns(int cols) => _InvalidConstraint(SR.Format(SR.DataKey_TooManyColumns, (cols).ToString(CultureInfo.InvariantCulture))); 557public static Exception KeyDuplicateColumns(string columnName) => _InvalidConstraint(SR.Format(SR.DataKey_DuplicateColumns, columnName)); 563public static Exception RelationDataSetMismatch() => _InvalidConstraint(SR.DataRelation_DataSetMismatch); 564public static Exception NoRelationName() => _Argument(SR.DataRelation_NoName); 565public static Exception ColumnsTypeMismatch() => _InvalidConstraint(SR.DataRelation_ColumnsTypeMismatch); 566public static Exception KeyLengthMismatch() => _Argument(SR.DataRelation_KeyLengthMismatch); 567public static Exception KeyLengthZero() => _Argument(SR.DataRelation_KeyZeroLength); 568public static Exception ForeignRelation() => _Argument(SR.DataRelation_ForeignDataSet); 569public static Exception KeyColumnsIdentical() => _InvalidConstraint(SR.DataRelation_KeyColumnsIdentical); 570public static Exception RelationForeignTable(string t1, string t2) => _InvalidConstraint(SR.Format(SR.DataRelation_ForeignTable, t1, t2)); 571public static Exception GetParentRowTableMismatch(string t1, string t2) => _InvalidConstraint(SR.Format(SR.DataRelation_GetParentRowTableMismatch, t1, t2)); 572public static Exception SetParentRowTableMismatch(string t1, string t2) => _InvalidConstraint(SR.Format(SR.DataRelation_SetParentRowTableMismatch, t1, t2)); 573public static Exception RelationForeignRow() => _Argument(SR.DataRelation_ForeignRow); 574public static Exception RelationNestedReadOnly() => _Argument(SR.DataRelation_RelationNestedReadOnly); 575public static Exception TableCantBeNestedInTwoTables(string tableName) => _Argument(SR.Format(SR.DataRelation_TableCantBeNestedInTwoTables, tableName)); 576public static Exception LoopInNestedRelations(string tableName) => _Argument(SR.Format(SR.DataRelation_LoopInNestedRelations, tableName)); 577public static Exception RelationDoesNotExist() => _Argument(SR.DataRelation_DoesNotExist); 578public static Exception ParentRowNotInTheDataSet() => _Argument(SR.DataRow_ParentRowNotInTheDataSet); 579public static Exception ParentOrChildColumnsDoNotHaveDataSet() => _InvalidConstraint(SR.DataRelation_ParentOrChildColumnsDoNotHaveDataSet); 580public static Exception InValidNestedRelation(string childTableName) => _InvalidOperation(SR.Format(SR.DataRelation_InValidNestedRelation, childTableName)); 581public static Exception InvalidParentNamespaceinNestedRelation(string childTableName) => _InvalidOperation(SR.Format(SR.DataRelation_InValidNamespaceInNestedRelation, childTableName)); 587public static Exception RowNotInTheDataSet() => _Argument(SR.DataRow_NotInTheDataSet); 588public static Exception RowNotInTheTable() => _RowNotInTable(SR.DataRow_NotInTheTable); 589public static Exception EditInRowChanging() => _InRowChangingEvent(SR.DataRow_EditInRowChanging); 590public static Exception EndEditInRowChanging() => _InRowChangingEvent(SR.DataRow_EndEditInRowChanging); 591public static Exception BeginEditInRowChanging() => _InRowChangingEvent(SR.DataRow_BeginEditInRowChanging); 592public static Exception CancelEditInRowChanging() => _InRowChangingEvent(SR.DataRow_CancelEditInRowChanging); 593public static Exception DeleteInRowDeleting() => _InRowChangingEvent(SR.DataRow_DeleteInRowDeleting); 594public static Exception ValueArrayLength() => _Argument(SR.DataRow_ValuesArrayLength); 595public static Exception NoCurrentData() => _VersionNotFound(SR.DataRow_NoCurrentData); 596public static Exception NoOriginalData() => _VersionNotFound(SR.DataRow_NoOriginalData); 597public static Exception NoProposedData() => _VersionNotFound(SR.DataRow_NoProposedData); 598public static Exception RowRemovedFromTheTable() => _RowNotInTable(SR.DataRow_RemovedFromTheTable); 599public static Exception DeletedRowInaccessible() => _DeletedRowInaccessible(SR.DataRow_DeletedRowInaccessible); 600public static Exception RowAlreadyDeleted() => _DeletedRowInaccessible(SR.DataRow_AlreadyDeleted); 601public static Exception RowEmpty() => _Argument(SR.DataRow_Empty); 602public static Exception InvalidRowVersion() => _Data(SR.DataRow_InvalidVersion); 603public static Exception RowOutOfRange() => _IndexOutOfRange(SR.DataRow_RowOutOfRange); 604public static Exception RowOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataRow_OutOfRange, (index).ToString(CultureInfo.InvariantCulture))); 605public static Exception RowInsertOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataRow_RowInsertOutOfRange, (index).ToString(CultureInfo.InvariantCulture))); 606public static Exception RowInsertTwice(int index, string tableName) => _IndexOutOfRange(SR.Format(SR.DataRow_RowInsertTwice, (index).ToString(CultureInfo.InvariantCulture), tableName)); 607public static Exception RowInsertMissing(string tableName) => _IndexOutOfRange(SR.Format(SR.DataRow_RowInsertMissing, tableName)); 608public static Exception RowAlreadyRemoved() => _Data(SR.DataRow_AlreadyRemoved); 609public static Exception MultipleParents() => _Data(SR.DataRow_MultipleParents); 610public static Exception InvalidRowState(DataRowState state) => _InvalidEnumArgumentException<DataRowState>(state); 611public static Exception InvalidRowBitPattern() => _Argument(SR.DataRow_InvalidRowBitPattern); 617internal static Exception SetDataSetNameToEmpty() => _Argument(SR.DataSet_SetNameToEmpty); 618internal static Exception SetDataSetNameConflicting(string name) => _Argument(SR.Format(SR.DataSet_SetDataSetNameConflicting, name)); 619public static Exception DataSetUnsupportedSchema(string ns) => _Argument(SR.Format(SR.DataSet_UnsupportedSchema, ns)); 620public static Exception MergeMissingDefinition(string obj) => _Argument(SR.Format(SR.DataMerge_MissingDefinition, obj)); 621public static Exception TablesInDifferentSets() => _Argument(SR.DataRelation_TablesInDifferentSets); 622public static Exception RelationAlreadyExists() => _Argument(SR.DataRelation_AlreadyExists); 623public static Exception RowAlreadyInOtherCollection() => _Argument(SR.DataRow_AlreadyInOtherCollection); 624public static Exception RowAlreadyInTheCollection() => _Argument(SR.DataRow_AlreadyInTheCollection); 625public static Exception TableMissingPrimaryKey() => _MissingPrimaryKey(SR.DataTable_MissingPrimaryKey); 626public static Exception RecordStateRange() => _Argument(SR.DataIndex_RecordStateRange); 627public static Exception IndexKeyLength(int length, int keyLength) => length == 0 ? 630public static Exception RemovePrimaryKey(DataTable table) => table.TableName.Length == 0 ? 633public static Exception RelationAlreadyInOtherDataSet() => _Argument(SR.DataRelation_AlreadyInOtherDataSet); 634public static Exception RelationAlreadyInTheDataSet() => _Argument(SR.DataRelation_AlreadyInTheDataSet); 635public static Exception RelationNotInTheDataSet(string relation) => _Argument(SR.Format(SR.DataRelation_NotInTheDataSet, relation)); 636public static Exception RelationOutOfRange(object index) => _IndexOutOfRange(SR.Format(SR.DataRelation_OutOfRange, Convert.ToString(index, null))); 637public static Exception DuplicateRelation(string relation) => _DuplicateName(SR.Format(SR.DataRelation_DuplicateName, relation)); 638public static Exception RelationTableNull() => _Argument(SR.DataRelation_TableNull); 639public static Exception RelationDataSetNull() => _Argument(SR.DataRelation_TableNull); 640public static Exception RelationTableWasRemoved() => _Argument(SR.DataRelation_TableWasRemoved); 641public static Exception ParentTableMismatch() => _Argument(SR.DataRelation_ParentTableMismatch); 642public static Exception ChildTableMismatch() => _Argument(SR.DataRelation_ChildTableMismatch); 643public static Exception EnforceConstraint() => _Constraint(SR.Data_EnforceConstraints); 644public static Exception CaseLocaleMismatch() => _Argument(SR.DataRelation_CaseLocaleMismatch); 645public static Exception CannotChangeCaseLocale() => CannotChangeCaseLocale(null); 646public static Exception CannotChangeCaseLocale(Exception? innerException) => _Argument(SR.DataSet_CannotChangeCaseLocale, innerException); 647public static Exception CannotChangeSchemaSerializationMode() => _InvalidOperation(SR.DataSet_CannotChangeSchemaSerializationMode); 648public static Exception InvalidSchemaSerializationMode(Type enumType, string mode) => _InvalidEnumArgumentException(SR.Format(SR.ADP_InvalidEnumerationValue, enumType.Name, mode)); 649public static Exception InvalidRemotingFormat(SerializationFormat mode) => _InvalidEnumArgumentException(mode); 650public static Exception SerializationFormatBinaryNotSupported() => _InvalidEnumArgumentException(SerializationFormat.Binary); 655public static Exception TableForeignPrimaryKey() => _Argument(SR.DataTable_ForeignPrimaryKey); 656public static Exception TableCannotAddToSimpleContent() => _Argument(SR.DataTable_CannotAddToSimpleContent); 657public static Exception NoTableName() => _Argument(SR.DataTable_NoName); 658public static Exception MultipleTextOnlyColumns() => _Argument(SR.DataTable_MultipleSimpleContentColumns); 659public static Exception InvalidSortString(string sort) => _Argument(SR.Format(SR.DataTable_InvalidSortString, sort)); 660public static Exception DuplicateTableName(string table) => _DuplicateName(SR.Format(SR.DataTable_DuplicateName, table)); 661public static Exception DuplicateTableName2(string table, string ns) => _DuplicateName(SR.Format(SR.DataTable_DuplicateName2, table, ns)); 662public static Exception SelfnestedDatasetConflictingName(string table) => _DuplicateName(SR.Format(SR.DataTable_SelfnestedDatasetConflictingName, table)); 663public static Exception DatasetConflictingName(string table) => _DuplicateName(SR.Format(SR.DataTable_DatasetConflictingName, table)); 664public static Exception TableAlreadyInOtherDataSet() => _Argument(SR.DataTable_AlreadyInOtherDataSet); 665public static Exception TableAlreadyInTheDataSet() => _Argument(SR.DataTable_AlreadyInTheDataSet); 666public static Exception TableOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataTable_OutOfRange, (index).ToString(CultureInfo.InvariantCulture))); 667public static Exception TableNotInTheDataSet(string table) => _Argument(SR.Format(SR.DataTable_NotInTheDataSet, table)); 668public static Exception TableInRelation() => _Argument(SR.DataTable_InRelation); 669public static Exception TableInConstraint(DataTable table, Constraint constraint) => _Argument(SR.Format(SR.DataTable_InConstraint, table.TableName, constraint.ConstraintName)); 670public static Exception CanNotSerializeDataTableHierarchy() => _InvalidOperation(SR.DataTable_CanNotSerializeDataTableHierarchy); 671public static Exception CanNotRemoteDataTable() => _InvalidOperation(SR.DataTable_CanNotRemoteDataTable); 672public static Exception CanNotSetRemotingFormat() => _Argument(SR.DataTable_CanNotSetRemotingFormat); 673public static Exception CanNotSerializeDataTableWithEmptyName() => _InvalidOperation(SR.DataTable_CanNotSerializeDataTableWithEmptyName); 674public static Exception TableNotFound(string tableName) => _Argument(SR.Format(SR.DataTable_TableNotFound, tableName)); 680public static Exception AggregateException(AggregateType aggregateType, Type type) => _Data(SR.Format(SR.DataStorage_AggregateException, aggregateType, type.Name)); 681public static Exception InvalidStorageType(TypeCode typecode) => _Data(SR.Format(SR.DataStorage_InvalidStorageType, typecode.ToString())); 682public static Exception RangeArgument(int min, int max) => _Argument(SR.Format(SR.Range_Argument, (min).ToString(CultureInfo.InvariantCulture), (max).ToString(CultureInfo.InvariantCulture))); 683public static Exception NullRange() => _Data(SR.Range_NullRange); 684public static Exception NegativeMinimumCapacity() => _Argument(SR.RecordManager_MinimumCapacity); 685public static Exception ProblematicChars(char charValue) => _Argument(SR.Format(SR.DataStorage_ProblematicChars, $"0x{(ushort)charValue:X}")); 686public static Exception StorageSetFailed() => _Argument(SR.DataStorage_SetInvalidDataType); 692public static Exception SimpleTypeNotSupported() => _Data(SR.Xml_SimpleTypeNotSupported); 693public static Exception MissingAttribute(string attribute) => MissingAttribute(string.Empty, attribute); 694public static Exception MissingAttribute(string element, string attribute) => _Data(SR.Format(SR.Xml_MissingAttribute, element, attribute)); 695public static Exception InvalidAttributeValue(string name, string value) => _Data(SR.Format(SR.Xml_ValueOutOfRange, name, value)); 696public static Exception AttributeValues(string name, string value1, string value2) => _Data(SR.Format(SR.Xml_AttributeValues, name, value1, value2)); 697public static Exception ElementTypeNotFound(string name) => _Data(SR.Format(SR.Xml_ElementTypeNotFound, name)); 698public static Exception RelationParentNameMissing(string rel) => _Data(SR.Format(SR.Xml_RelationParentNameMissing, rel)); 699public static Exception RelationChildNameMissing(string rel) => _Data(SR.Format(SR.Xml_RelationChildNameMissing, rel)); 700public static Exception RelationTableKeyMissing(string rel) => _Data(SR.Format(SR.Xml_RelationTableKeyMissing, rel)); 701public static Exception RelationChildKeyMissing(string rel) => _Data(SR.Format(SR.Xml_RelationChildKeyMissing, rel)); 702public static Exception UndefinedDatatype(string name) => _Data(SR.Format(SR.Xml_UndefinedDatatype, name)); 703public static Exception DatatypeNotDefined() => _Data(SR.Xml_DatatypeNotDefined); 704public static Exception MismatchKeyLength() => _Data(SR.Xml_MismatchKeyLength); 705public static Exception InvalidField(string name) => _Data(SR.Format(SR.Xml_InvalidField, name)); 706public static Exception InvalidSelector(string name) => _Data(SR.Format(SR.Xml_InvalidSelector, name)); 707public static Exception CircularComplexType(string name) => _Data(SR.Format(SR.Xml_CircularComplexType, name)); 708public static Exception CannotInstantiateAbstract(string name) => _Data(SR.Format(SR.Xml_CannotInstantiateAbstract, name)); 709public static Exception InvalidKey(string name) => _Data(SR.Format(SR.Xml_InvalidKey, name)); 710public static Exception DiffgramMissingSQL() => _Data(SR.Xml_MissingSQL); 711public static Exception DuplicateConstraintRead(string str) => _Data(SR.Format(SR.Xml_DuplicateConstraint, str)); 712public static Exception ColumnTypeConflict(string name) => _Data(SR.Format(SR.Xml_ColumnConflict, name)); 713public static Exception CannotConvert(string name, string? type) => _Data(SR.Format(SR.Xml_CannotConvert, name, type)); 714public static Exception MissingRefer(string name) => _Data(SR.Format(SR.Xml_MissingRefer, Keywords.REFER, Keywords.XSD_KEYREF, name)); 715public static Exception InvalidPrefix(string name) => _Data(SR.Format(SR.Xml_InvalidPrefix_SpecialCharacters, name)); 716public static Exception CanNotDeserializeObjectType() => _InvalidOperation(SR.Xml_CanNotDeserializeObjectType); 717public static Exception IsDataSetAttributeMissingInSchema() => _Data(SR.Xml_IsDataSetAttributeMissingInSchema); 718public static Exception TooManyIsDataSetAttributesInSchema() => _Data(SR.Xml_TooManyIsDataSetAttributesInSchema); 721public static Exception NestedCircular(string name) => _Data(SR.Format(SR.Xml_NestedCircular, name)); 722public static Exception MultipleParentRows(string tableQName) => _Data(SR.Format(SR.Xml_MultipleParentRows, tableQName)); 723public static Exception PolymorphismNotSupported(string typeName) => _InvalidOperation(SR.Format(SR.Xml_PolymorphismNotSupported, typeName)); 724public static Exception DataTableInferenceNotSupported() => _InvalidOperation(SR.Xml_DataTableInferenceNotSupported); 727internal static void ThrowMultipleTargetConverter(Exception? innerException) 734public static Exception DuplicateDeclaration(string name) => _Data(SR.Format(SR.Xml_MergeDuplicateDeclaration, name)); 737public static Exception FoundEntity() => _Data(SR.Xml_FoundEntity); 738public static Exception MergeFailed(string name) => _Data(name); 741public static Exception ConvertFailed(Type type1, Type type2) => _Data(SR.Format(SR.SqlConvert_ConvertFailed, type1.FullName, type2.FullName)); 744public static Exception InvalidDataTableReader(string tableName) => _InvalidOperation(SR.Format(SR.DataTableReader_InvalidDataTableReader, tableName)); 745public static Exception DataTableReaderSchemaIsInvalid(string tableName) => _InvalidOperation(SR.Format(SR.DataTableReader_SchemaInvalidDataTableReader, tableName)); 746public static Exception CannotCreateDataReaderOnEmptyDataSet() => _Argument(SR.DataTableReader_CannotCreateDataReaderOnEmptyDataSet); 747public static Exception DataTableReaderArgumentIsEmpty() => _Argument(SR.DataTableReader_DataTableReaderArgumentIsEmpty); 748public static Exception ArgumentContainsNullValue() => _Argument(SR.DataTableReader_ArgumentContainsNullValue); 749public static Exception InvalidCurrentRowInDataTableReader() => _DeletedRowInaccessible(SR.DataTableReader_InvalidRowInDataTableReader); 750public static Exception EmptyDataTableReader(string tableName) => _DeletedRowInaccessible(SR.Format(SR.DataTableReader_DataTableCleared, tableName)); 751internal static Exception InvalidDuplicateNamedSimpleTypeDelaration(string stName, string errorStr) => _Argument(SR.Format(SR.NamedSimpleType_InvalidDuplicateNamedSimpleTypeDelaration, stName, errorStr)); 754internal static Exception InternalRBTreeError(RBTreeError internalError) => _InvalidOperation(SR.Format(SR.RbTree_InvalidState, (int)internalError)); 755public static Exception EnumeratorModified() => _InvalidOperation(SR.RbTree_EnumerationBroken);
System\Data\DataRelation.cs (1)
675catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\DataRelationCollection.cs (1)
818catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e))
System\Data\DataRow.cs (2)
336catch (Exception e1) when (Common.ADP.IsCatchableOrSecurityExceptionType(e1)) 508catch (Exception e1) when (Common.ADP.IsCatchableOrSecurityExceptionType(e1))
System\Data\DataSet.cs (1)
967catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\DataSetUtil.cs (1)
86internal static bool IsCatchableExceptionType(Exception e)
System\Data\DataTable.cs (10)
990Exception? first = null; 1012catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 1455catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 2750Exception? deferredException; 3414catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e)) 4131catch (Exception f) when (ADP.IsCatchableExceptionType(f)) 4259Exception? deferredException; 4268int position, bool fireEvent, out Exception? deferredException) 4456catch (Exception exc) 4478catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\DataTableExtensions.cs (1)
175catch (Exception e)
System\Data\DataView.cs (2)
1420catch (Exception f) when (Common.ADP.IsCatchableExceptionType(f)) 1502catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e))
System\Data\DataViewManager.cs (1)
323catch (Exception f) when (Common.ADP.IsCatchableExceptionType(f))
System\Data\DBConcurrencyException.cs (2)
24public DBConcurrencyException(string? message, Exception? inner) : base(message ?? SR.ADP_DBConcurrencyExceptionMessage, inner) 29public DBConcurrencyException(string? message, Exception? inner, DataRow[]? dataRows) : base(message ?? SR.ADP_DBConcurrencyExceptionMessage, inner)
System\Data\FillErrorEventArgs.cs (2)
10private Exception? _errors; 27public Exception? Errors
System\Data\Filter\DataExpression.cs (2)
147catch (Exception e) when (ADP.IsCatchableExceptionType(e)) 270catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\Filter\ExpressionParser.cs (2)
259catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e)) 606catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e))
System\Data\Filter\FilterException.cs (50)
25public InvalidExpressionException(string? message, Exception? innerException) : base(message, innerException) { } 42public EvaluateException(string? message, Exception? innerException) : base(message, innerException) { } 59public SyntaxErrorException(string? message, Exception? innerException) : base(message, innerException) { } 89public static Exception InvokeArgument() 94public static Exception NYI(string moreinfo) 101public static Exception MissingOperand(OperatorInfo before) 106public static Exception MissingOperator(string token) 111public static Exception TypeMismatch(string expr) 116public static Exception FunctionArgumentOutOfRange(string arg, string func) 121public static Exception ExpressionTooComplex() 126public static Exception UnboundName(string name) 131public static Exception InvalidString(string str) 136public static Exception UndefinedFunction(string name) 141public static Exception SyntaxError() 146public static Exception FunctionArgumentCount(string name) 151public static Exception MissingRightParen() 156public static Exception UnknownToken(string token, int position) 161public static Exception UnknownToken(Tokens tokExpected, Tokens tokCurr, int position) 166public static Exception DatatypeConversion(Type type1, Type type2) 171public static Exception DatavalueConversion(object value, Type type) 176public static Exception InvalidName(string name) 181public static Exception InvalidDate(string date) 186public static Exception NonConstantArgument() 191public static Exception InvalidPattern(string pat) 196public static Exception InWithoutParentheses() 201public static Exception InWithoutList() 206public static Exception InvalidIsSyntax() 211public static Exception Overflow(Type type) 216public static Exception ArgumentType(string function, int arg, Type type) 221public static Exception ArgumentTypeInteger(string function, int arg) 226public static Exception TypeMismatchInBinop(int op, Type type1, Type type2) 231public static Exception AmbiguousBinop(int op, Type type1, Type type2) 236public static Exception UnsupportedOperator(int op) 241public static Exception InvalidNameBracketing(string name) 246public static Exception MissingOperandBefore(string op) 251public static Exception TooManyRightParentheses() 256public static Exception UnresolvedRelation(string name, string expr) 266public static Exception AggregateArgument() 271public static Exception AggregateUnbound(string expr) 276public static Exception EvalNoContext() 281public static Exception ExpressionUnbound(string expr) 286public static Exception ComputeNotAggregate(string expr) 291public static Exception FilterConversion(string expr) 296public static Exception LookupArgument() 301public static Exception InvalidType(string typeName) 306public static Exception InvalidHoursArgument() 311public static Exception InvalidMinutesArgument() 316public static Exception InvalidTimeZoneRange() 321public static Exception MismatchKindandTimeSpan() 326public static Exception UnsupportedDataType(Type type)
System\Data\Filter\NameNode.cs (1)
44catch (Exception e)
System\Data\Merger.cs (1)
591catch (Exception e) when (Common.ADP.IsCatchableExceptionType(e))
System\Data\ProviderBase\SchemaMapping.cs (2)
751catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e)) 1129catch (Exception e) when (ADP.IsCatchableOrSecurityExceptionType(e))
System\Data\RecordManager.cs (1)
249catch (Exception e) when (Common.ADP.IsCatchableOrSecurityExceptionType(e))
System\Data\Select.cs (1)
629catch (Exception e) when (ADP.IsCatchableExceptionType(e))
System\Data\SQLTypes\SQLUtility.cs (5)
40public SqlTypeException(string? message, Exception? e) : base(message, e) 78public SqlNullValueException(string? message, Exception? e) : base(message, e) 116public SqlTruncateException(string? message, Exception? e) : base(message, e) 154public SqlNotFilledException(string? message, Exception? e) : base(message, e) 179public SqlAlreadyFilledException(string? message, Exception? e) : base(message, e)
System\Data\SQLTypes\SqlXml.cs (1)
105catch (Exception ex)
System\Data\StrongTypingException.cs (1)
33public StrongTypingException(string? s, Exception? innerException) : base(s, innerException)
System\Data\xmlsaver.cs (1)
2248catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
System\Xml\XmlDataDocument.cs (4)
903catch (Exception e) when (Data.Common.ADP.IsCatchableExceptionType(e)) 1439catch (Exception e) when (Data.Common.ADP.IsCatchableExceptionType(e)) 1701catch (Exception e) when (Data.Common.ADP.IsCatchableExceptionType(e)) 2398catch (Exception e) when (Data.Common.ADP.IsCatchableExceptionType(e))
System.Data.Odbc (99)
Common\System\Data\Common\AdapterUtil.Odbc.cs (54)
41internal static Exception ExceptionWithStackTrace(Exception e) 47catch (Exception caught) 62internal static InvalidOperationException InvalidOperation(string error, Exception? inner) 213internal static Exception MethodNotImplemented([CallerMemberName] string methodName = "") 222internal static Exception OdbcNoTypesFromProvider() 230internal static Exception PooledOpenTimeout() 235internal static Exception NonPooledOpenTimeout() 255internal static Exception CommandTextRequired(string method) 270internal static Exception OpenReaderExists() 275internal static Exception OpenReaderExists(Exception? e) 283internal static Exception NonSeqByteAccess(long badIndex, long currIndex, string method) 288internal static Exception NumericToDecimalOverflow() 296internal static Exception InvalidCommandTimeout(int value) 300internal static Exception DeriveParametersNotSupported(IDbCommand value) 304internal static Exception UninitializedParameterSize(int index, Type dataType) 316internal static Exception ConnectionIsDisabled(Exception? InnerException) 320internal static Exception ClosedConnectionError() 324internal static Exception ConnectionAlreadyOpen(ConnectionState state) 328internal static Exception OpenConnectionPropertySet(string property, ConnectionState state) 332internal static Exception EmptyDatabaseName() 336internal static Exception DatabaseNameTooLong() 348internal static Exception InternalConnectionError(ConnectionError internalError) 356internal static Exception DataReaderNoData() 389internal static Exception ParameterConversionFailed(object value, Type destType, Exception inner) 394Exception e; 423internal static Exception ParametersMappingIndex(int index, IDataParameterCollection collection) 427internal static Exception ParametersSourceIndex(string parameterName, IDataParameterCollection collection, Type parameterType) 431internal static Exception ParameterNull(string parameter, IDataParameterCollection collection, Type parameterType) 435internal static Exception InvalidParameterType(IDataParameterCollection collection, Type parameterType, object invalidValue) 443internal static Exception ParallelTransactionsNotSupported(IDbConnection obj) 447internal static Exception TransactionZombied(IDbTransaction obj) 451internal static Exception OffsetOutOfRangeException() 460internal static Exception AmbiguousCollectionName(string collectionName) 465internal static Exception CollectionNameIsNotUnique(string collectionName) 470internal static Exception DataTableDoesNotExist(string collectionName) 475internal static Exception IncorrectNumberOfDataSourceInformationRows() 485internal static Exception InvalidXml() 490internal static Exception InvalidXmlMissingColumn(string collectionName, string columnName) 495internal static Exception InvalidXmlInvalidValue(string collectionName, string columnName) 500internal static Exception MissingDataSourceInformationColumn() 505internal static Exception MissingRestrictionColumn() 510internal static Exception MissingRestrictionRow() 515internal static Exception NoColumns() 520internal static Exception QueryFailed(string collectionName, Exception e) 525internal static Exception TooManyRestrictions(string collectionName) 530internal static Exception UnableToBuildCollection(string collectionName) 535internal static Exception UndefinedCollection(string collectionName) 540internal static Exception UndefinedPopulationMechanism(string populationMechanism) 545internal static Exception UnsupportedVersion(string collectionName)
Common\System\Data\ProviderBase\DbConnectionPool.cs (5)
119private Exception? _resError; 429catch (Exception e) 577private Exception? TryCloneCachedException() 622Exception? caughtException = null; 630catch (Exception e)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (16)
31static partial void TraceException(string trace, Exception e); 33internal static void TraceExceptionAsReturnValue(Exception e) 38internal static void TraceExceptionWithoutRethrow(Exception e) 51internal static ArgumentException Argument(string error, Exception? inner) 105internal static InvalidCastException InvalidCast(string error, Exception? inner) 240internal static bool IsCatchableExceptionType(Exception e) 254internal static bool IsCatchableOrSecurityExceptionType(Exception e) 290internal static ArgumentException ConvertFailed(Type fromType, Type toType, Exception? innerException) 298internal static Exception InvalidConnectionOptionValue(string key) 302internal static Exception InvalidConnectionOptionValue(string key, Exception? inner) 357internal static Exception StreamClosed([CallerMemberName] string method = "") 446internal static Exception InternalError(InternalErrorCode internalError) 454internal static Exception DataReaderClosed([CallerMemberName] string method = "") 470internal static Exception InvalidDataLength(long length) 492internal static Exception InvalidSeekOrigin(string parameterName)
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (1)
493private static void ParseComparison(Dictionary<string, string?> parsetable, string connectionString, Dictionary<string, string>? synonyms, bool firstKey, Exception? e)
src\libraries\Common\src\System\Data\ProviderBase\DbMetaDataFactory.cs (1)
156catch (Exception e)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Data\Odbc\Odbc32.cs (10)
13internal static Exception ConnectionClosed() 18internal static Exception OpenConnectionNoOwner() 23internal static Exception UnknownSQLType(ODBC32.SQL_TYPE sqltype) 84internal static Exception NegativeArgument() 88internal static Exception CantSetPropertyOnOpenConnection() 92internal static Exception CantEnableConnectionpooling(ODBC32.SQLRETURN retcode) 96internal static Exception CantAllocateEnvironmentHandle(ODBC32.SQLRETURN retcode) 100internal static Exception FailedToGetDescriptorHandle(ODBC32.SQLRETURN retcode) 104internal static Exception NotInTransaction() 108internal static Exception UnknownOdbcType(OdbcType odbctype)
System\Data\Odbc\OdbcCommand.cs (2)
1103catch (Exception e) 1126catch (Exception e)
System\Data\Odbc\OdbcConnection.cs (4)
326internal bool ConnectionIsAlive(Exception? innerException) 516internal Exception? HandleErrorNoThrow(OdbcHandle hrHandle, ODBC32.SQLRETURN retcode) 547Exception? e = HandleErrorNoThrow(hrHandle, retcode); 587catch (Exception e)
System\Data\Odbc\OdbcDataReader.cs (1)
319Exception? error = null;
System\Data\Odbc\OdbcParameter.cs (1)
1001catch (Exception e)
System\Data\Odbc\OdbcTransaction.cs (2)
115Exception e = _connection.HandleErrorNoThrow(handle, retcode)!; 120catch (Exception e)
System.Diagnostics.DiagnosticSource (18)
System\Diagnostics\Activity.cs (2)
552public Activity AddException(Exception exception, in TagList tags = default, DateTimeOffset timestamp = default) 1307private static void NotifyError(Exception exception)
System\Diagnostics\ActivityListener.cs (1)
16public delegate void ExceptionRecorder(Activity activity, Exception exception, ref TagList tags);
System\Diagnostics\ActivitySource.cs (2)
397internal void NotifyActivityAddException(Activity activity, Exception exception, ref TagList tags) 502public void EnumWithExceptionNotification(Activity activity, Exception exception, ref TagList tags)
System\Diagnostics\DsesFilterAndTransform.cs (2)
688try { ret = fetch!.Fetch(obj); } catch (Exception e) { _eventSource.Message($"Property {objType}.{_propertyName} threw the exception {e}"); } 971public void OnError(Exception error) { }
System\Diagnostics\Metrics\AggregationManager.cs (6)
42private readonly Action<Exception> _collectionError; 45private readonly Action<Exception> _observableInstrumentCallbackError; 57Action<Exception> collectionError, 60Action<Exception> observableInstrumentCallbackError) 243catch (Exception e) 434catch (Exception e)
System\Diagnostics\Metrics\MeterListener.cs (3)
218List<Exception>? exceptionsList = null; 228catch (Exception e) 230exceptionsList ??= new List<Exception>();
System\Diagnostics\Metrics\MetricsEventSource.cs (2)
487catch (Exception e) when (LogError(e)) 651private bool LogError(Exception e)
System.Diagnostics.EventLog (6)
artifacts\obj\System.Diagnostics.EventLog\Debug\net10.0\System.Diagnostics.EventLog.notsupported.cs (6)
236public EventLogException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } 265public EventLogInvalidDataException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } 295public EventLogNotFoundException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } 312public EventLogProviderDisabledException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } 348public EventLogReadingException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } 489public System.Exception EventException { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); } }
System.Diagnostics.Process (15)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (4)
83catch (Exception e) 197catch (Exception e) 384catch (Exception e) 463catch (Exception e)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
170catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
System\Diagnostics\AsyncStreamReader.cs (1)
242catch (Exception e)
System\Diagnostics\Process.NonUap.cs (2)
28List<Exception>? result = KillTree(); 102private static bool IsProcessInvalidException(Exception e) =>
System\Diagnostics\Process.Unix.cs (7)
94private List<Exception>? KillTree() 96List<Exception>? exceptions = null; 101private void KillTree(ref List<Exception>? exceptions) 119(exceptions ??= new List<Exception>()).Add(new Win32Exception()); 133(exceptions ??= new List<Exception>()).Add(new Win32Exception()); 313catch (Exception e) when (IsProcessInvalidException(e)) 325catch (Exception e) when (IsProcessInvalidException(e))
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
212catch (Exception e) when (e is BadImageFormatException || e is IOException)
System.Diagnostics.TextWriterTraceListener (2)
System\Diagnostics\TextWriterTraceListener.cs (1)
250catch (Exception)
System\Diagnostics\XmlWriterTraceListener.cs (1)
177catch (Exception)
System.Diagnostics.TraceSource (2)
System\Diagnostics\DefaultTraceListener.cs (1)
167catch (Exception e)
System\Diagnostics\Switch.cs (1)
237catch (Exception)
System.DirectoryServices (11)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (11)
264public DirectoryServicesCOMException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 548public ActiveDirectoryObjectExistsException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 559public ActiveDirectoryObjectNotFoundException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 578public ActiveDirectoryOperationException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 579public ActiveDirectoryOperationException(string? message, System.Exception? inner, int errorCode) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 752public ActiveDirectoryServerDownException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 753public ActiveDirectoryServerDownException(string? message, System.Exception? inner, int errorCode, string? name) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 1320public ForestTrustCollisionException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 1321public ForestTrustCollisionException(string? message, System.Exception? inner, System.DirectoryServices.ActiveDirectory.ForestTrustRelationshipCollisionCollection? collisions) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 1712public SyncFromAllServersOperationException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 1713public SyncFromAllServersOperationException(string? message, System.Exception? inner, System.DirectoryServices.ActiveDirectory.SyncFromAllServersErrorInformation[]? errors) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); }
System.DirectoryServices.AccountManagement (9)
artifacts\obj\System.DirectoryServices.AccountManagement\Debug\net10.0\System.DirectoryServices.AccountManagement.notsupported.cs (9)
160public MultipleMatchesException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 171public NoMatchingPrincipalException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 182public PasswordException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 294public PrincipalExistsException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 305public PrincipalOperationException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 306public PrincipalOperationException(string message, System.Exception innerException, int errorCode) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 343public PrincipalServerDownException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 344public PrincipalServerDownException(string message, System.Exception innerException, int errorCode) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 345public PrincipalServerDownException(string message, System.Exception innerException, int errorCode, string serverName) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); }
System.DirectoryServices.Protocols (8)
artifacts\obj\System.DirectoryServices.Protocols\Debug\net10.0\System.DirectoryServices.Protocols.notsupported.cs (8)
55public BerConversionException(string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 203public DirectoryException(string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 222public DirectoryOperationException(System.DirectoryServices.Protocols.DirectoryResponse response, string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 229public DirectoryOperationException(string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 362public LdapException(int errorCode, string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 370public LdapException(string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 729public TlsOperationException(System.DirectoryServices.Protocols.DirectoryResponse response, string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); } 736public TlsOperationException(string message, System.Exception inner) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesProtocols_PlatformNotSupported); }
System.Drawing.Common.Tests (9)
mono\System.Drawing\GraphicsTests.cs (2)
348Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => Graphics.FromImage(img));
System\Drawing\ColorTranslatorTests.cs (2)
210Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => ColorTranslator.FromHtml(htmlColor));
System\Drawing\GraphicsTests.cs (2)
268Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => Graphics.FromImage(image));
System\Drawing\Printing\MarginsConverterTests.cs (3)
89AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, culture, "1;2;3;4")); 112AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, null, "wrong string format")); 113AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, culture, "wrong string format"));
System.Drawing.Primitives (2)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
110catch (Exception e)
System\Drawing\ColorTranslator.cs (1)
276catch (Exception ex)
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnContentException.cs (1)
44public AsnContentException(string? message, Exception? inner)
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (1)
396catch (Exception e)
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
234catch (Exception e)
System.Formats.Cbor (1)
System\Formats\Cbor\CborContentException.cs (1)
29public CborContentException(string? message, Exception? inner)
System.Formats.Tar (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System.IO.Compression (5)
System\IO\Compression\DeflateZLib\Deflater.cs (2)
40catch (Exception cause) 199catch (Exception cause)
System\IO\Compression\DeflateZLib\Inflater.cs (2)
247catch (Exception exception) // could not load the ZLib dll 298catch (Exception cause) // could not load the Zlib DLL correctly
System\IO\Compression\DeflateZLib\ZLibException.cs (1)
49public ZLibException(string? message, Exception? innerException) : base(message, innerException) { }
System.IO.Compression.ZipFile (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System.IO.FileSystem.DriveInfo (6)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MountPoints.cs (1)
31catch (Exception e)
System\IO\DriveNotFoundException.cs (1)
26public DriveNotFoundException(string? message, Exception? innerException)
System.IO.FileSystem.Watcher (12)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System\IO\ErrorEventArgs.cs (4)
11private readonly Exception _exception; 16public ErrorEventArgs(Exception exception) 22/// Gets the <see cref='System.Exception'/> that represents the error that occurred. 24public virtual Exception GetException()
System\IO\FileSystemWatcher.Linux.cs (3)
374Exception exc; 463catch (Exception ex) 769catch (Exception exc)
System\IO\InternalBufferOverflowException.cs (1)
36public InternalBufferOverflowException(string? message, Exception? inner) : base(message, inner)
System.IO.IsolatedStorage (11)
System\IO\IsolatedStorage\IsolatedStorageException.cs (2)
18internal Exception? _underlyingException; 32public IsolatedStorageException(string? message, Exception? inner)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (8)
85catch (Exception e) 132catch (Exception e) 155catch (Exception e) 313catch (Exception e) 341catch (Exception e) 369catch (Exception e) 575internal static Exception GetIsolatedStorageException(string exceptionMsg, Exception rootCause)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
126catch (Exception e)
System.IO.MemoryMappedFiles (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System.IO.Packaging (12)
System\IO\Packaging\FileFormatException.cs (3)
43public FileFormatException(string? message, Exception? innerException) 89public FileFormatException(Uri? sourceUri, Exception? innerException) 110public FileFormatException(Uri? sourceUri, string? message, Exception? innerException)
System\IO\Packaging\InternalRelationshipCollection.cs (1)
584private static void ThrowForInvalidAttributeValue(XmlCompatibilityReader reader, string attributeName, Exception ex)
System\IO\Packaging\PackUriHelper.cs (8)
336Exception? exception = GetExceptionIfPartUriInvalid(partUri, out partUriString); 371Exception? exception = GetExceptionIfPartUriInvalid(partUri, out partUriString); 397private static Exception? GetExceptionIfPartUriInvalid(Uri partUri, out string partUriString) 406Exception? argumentException = GetExceptionIfAbsoluteUri(partUri); 467Exception? exception = GetExceptionIfAbsoluteUri(uri); 482Exception? exception = GetExceptionIfFragmentPresent(partName); 497Exception? exception = GetExceptionIfPartNameEndsWithSlash(partName); 514Exception? exception = GetExceptionIfPartNameStartsWithTwoSlashes(partName);
System.IO.Pipelines (32)
System\IO\Pipelines\Pipe.cs (4)
419internal void CompleteWriter(Exception? exception) 589internal void CompleteReader(Exception? exception) 624internal void OnWriterCompleted(Action<Exception?, object?> callback, object? state) 663internal void OnReaderCompleted(Action<Exception?, object?> callback, object? state)
System\IO\Pipelines\Pipe.DefaultPipeReader.cs (2)
34public override void Complete(Exception? exception = null) => _pipe.CompleteReader(exception); 37public override void OnWriterCompleted(Action<Exception?, object?> callback, object? state) => _pipe.OnWriterCompleted(callback, state);
System\IO\Pipelines\Pipe.DefaultPipeWriter.cs (2)
22public override void Complete(Exception? exception = null) => _pipe.CompleteWriter(exception); 29public override void OnReaderCompleted(Action<Exception?, object?> callback, object? state) => _pipe.OnReaderCompleted(callback, state);
System\IO\Pipelines\PipeCompletion.cs (2)
23public PipeCompletionCallbacks? TryComplete(Exception? exception = null) 40public PipeCompletionCallbacks? AddCallback(Action<Exception?, object?> callback, object? state)
System\IO\Pipelines\PipeCompletionCallback.cs (2)
8public readonly Action<Exception?, object?> Callback; 11public PipeCompletionCallback(Action<Exception?, object?> callback, object? state)
System\IO\Pipelines\PipeCompletionCallbacks.cs (5)
12private readonly Exception? _exception; 28List<Exception>? exceptions = null; 42private void Execute(PipeCompletionCallback callback, ref List<Exception>? exceptions) 48catch (Exception ex) 50exceptions ??= new List<Exception>();
System\IO\Pipelines\PipeReader.cs (5)
122/// <param name="exception">Optional <see cref="System.Exception" /> indicating a failure that's causing the pipeline to complete.</param> 123public abstract void Complete(Exception? exception = null); 128public virtual ValueTask CompleteAsync(Exception? exception = null) 135catch (Exception ex) 149public virtual void OnWriterCompleted(Action<Exception?, object?> callback, object? state)
System\IO\Pipelines\PipeWriter.cs (5)
16/// <param name="exception">Optional <see cref="System.Exception" /> indicating a failure that's causing the pipeline to complete.</param> 17public abstract void Complete(Exception? exception = null); 22public virtual ValueTask CompleteAsync(Exception? exception = null) 29catch (Exception ex) 51public virtual void OnReaderCompleted(Action<Exception?, object?> callback, object? state)
System\IO\Pipelines\SequencePipeReader.cs (1)
50public override void Complete(Exception? exception = null)
System\IO\Pipelines\StreamPipeReader.cs (2)
166public override void Complete(Exception? exception = null) 175public override ValueTask CompleteAsync(Exception? exception = null) =>
System\IO\Pipelines\StreamPipeWriter.cs (2)
213public override void Complete(Exception? exception = null) 237public override async ValueTask CompleteAsync(Exception? exception = null)
System.IO.Pipes (13)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System\IO\Error.cs (6)
9internal static Exception GetEndOfFile() 14internal static Exception GetPipeNotOpen() 19internal static Exception GetReadNotSupported() 24internal static Exception GetSeekNotSupported() 29internal static Exception GetWriteNotSupported() 34internal static Exception GetOperationAborted()
System\IO\Pipes\NamedPipeClientStream.Unix.cs (1)
69catch (Exception)
System\IO\Pipes\PipeStream.cs (1)
139catch (Exception ex)
System\IO\Pipes\PipeStream.Unix.cs (1)
520internal static Exception CreateExceptionForLastError(string? pipeName = null)
System.IO.Ports (7)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System\IO\Ports\InternalResources.cs (1)
22internal static Exception FileNotOpenException()
System\IO\Ports\SerialStream.Unix.cs (2)
1073private static Exception GetLastIOError() 1102internal void Complete(Exception exception)
System.Linq.Expressions (25)
System\Dynamic\Utils\ContractUtils.cs (1)
18public static Exception Unreachable
System\Linq\Expressions\CatchBlock.cs (15)
25/// Gets a reference to the <see cref="Exception"/> object caught by this handler. 30/// Gets the type of <see cref="Exception"/> this handler catches. 79/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 90/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param> 101/// an <see cref="Exception"/> filter but no reference to the caught <see cref="Exception"/> object. 103/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 105/// <param name="filter">The body of the <see cref="Exception"/> filter.</param> 114/// an <see cref="Exception"/> filter and a reference to the caught <see cref="Exception"/> object. 116/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param> 118/// <param name="filter">The body of the <see cref="Exception"/> filter.</param> 129/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 130/// <param name="variable">A <see cref="ParameterExpression"/> representing a reference to the <see cref="Exception"/> object caught by this handler.</param> 132/// <param name="filter">The body of the <see cref="Exception"/> filter.</param>
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (4)
323catch (Exception exception) when (_tryHandler.HasHandler(frame, exception, out ExceptionHandler? exHandler, out object? unwrappedException)) 726Exception? ex = WrapThrownObject(frame.Pop()); 735private static Exception? WrapThrownObject(object? thrown) => 736thrown == null ? null : (thrown as Exception ?? new RuntimeWrappedException(thrown));
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (2)
143internal void SaveTraceToException(Exception exception) 148public static InterpretedFrameInfo[]? GetExceptionStackTrace(Exception exception)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
102internal bool HasHandler(InterpretedFrame frame, Exception exception, [NotNullWhen(true)] out ExceptionHandler? handler, out object? unwrappedException)
System\Linq\Expressions\ParameterExpression.cs (2)
49else if (type == typeof(Exception)) 51return new PrimitiveParameterExpression<Exception>(name);
System.Linq.Parallel (49)
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (2)
129catch (Exception ex) 162catch (Exception ex)
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (1)
39protected override int InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (1)
37protected override decimal InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (1)
41protected override decimal InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (1)
37protected override decimal InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (1)
37protected override double InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (1)
47protected override double InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (1)
37protected override double InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (1)
37protected override float InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (1)
46protected override float InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (1)
37protected override float InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (3)
51Exception? toThrow = null; 57catch (Exception ex) 105protected abstract TResult InternalAggregate(ref Exception? singularExceptionToThrow);
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (1)
37protected override double InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (1)
41protected override int InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (1)
38protected override int InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (1)
37protected override double InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (1)
38protected override long InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (1)
41protected override long InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (1)
37protected override long InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (1)
37protected override decimal? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (1)
41protected override decimal? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (1)
37protected override decimal? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (1)
37protected override double? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (1)
47protected override double? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (1)
37protected override double? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (1)
37protected override float? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (1)
47protected override float? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (1)
37protected override float? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (1)
37protected override double? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (1)
41protected override int? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (1)
37protected override int? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (1)
37protected override double? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (1)
41protected override long? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (1)
37protected override long? InternalAggregate(ref Exception? singularExceptionToThrow)
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
49catch (Exception ex)
System\Linq\Parallel\Utils\ExceptionAggregator.cs (5)
43catch (Exception ex) 75catch (Exception ex) 98internal static void ThrowOCEorAggregateException(Exception ex, CancellationState cancellationState) 129catch (Exception ex) 139private static bool ThrowAnOCE(Exception ex, CancellationState cancellationState)
System\Linq\ParallelEnumerable.cs (6)
1578catch (Exception e) 1712catch (Exception e) 4402catch (Exception ex) 4429catch (Exception ex) 4981catch (Exception ex) 5078catch (Exception ex)
System.Linq.Queryable (6)
System\Linq\Error.cs (6)
8internal static Exception ArgumentNotIEnumerableGeneric(string message) => 11internal static Exception ArgumentNotValid(string message) => 14internal static Exception ArgumentOutOfRange(string message) => 17internal static Exception NoMethodOnType(string name, object type) => 20internal static Exception NoMethodOnTypeMatchingArguments(string name, object type) => 23internal static Exception EnumeratingNullEnumerableExpression() =>
System.Management (1)
artifacts\obj\System.Management\Debug\net10.0\System.Management.notsupported.cs (1)
251public ManagementException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); }
System.Memory (2)
System\ThrowHelper.cs (2)
64private static Exception CreateArgumentValidationException<T>(ReadOnlySequenceSegment<T>? startSegment, int startIndex, ReadOnlySequenceSegment<T>? endSegment) 82private static Exception CreateArgumentValidationException(Array? array, int start)
System.Net.Http (170)
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs (1)
21public HPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs (1)
17public HPackEncodingException(string message, Exception innerException)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs (1)
20public QPackDecodingException(string message, Exception innerException) : base(message, innerException)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs (1)
16public QPackEncodingException(string message, Exception innerException)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\Http\CancellationHelper.cs (6)
15/// <summary>Determines whether to wrap an <see cref="Exception"/> in a cancellation exception.</summary> 19internal static bool ShouldWrapInOperationCanceledException(Exception exception, CancellationToken cancellationToken) => 26internal static Exception CreateOperationCanceledException(Exception? innerException, CancellationToken cancellationToken) => 32private static void ThrowOperationCanceledException(Exception? innerException, CancellationToken cancellationToken) => 45internal static void ThrowIfCancellationRequested(Exception? innerException, CancellationToken cancellationToken)
System\Net\Http\DiagnosticsHandler.cs (8)
161Exception? exception = null; 177catch (Exception ex) 292[DynamicDependency(nameof(System.Exception.Message), typeof(Exception))] 293[DynamicDependency(nameof(System.Exception.StackTrace), typeof(Exception))] 294internal ExceptionData(Exception exception, HttpRequestMessage request) 300public Exception Exception { get; }
System\Net\Http\DiagnosticsHelper.cs (1)
62public static bool TryGetErrorType(HttpResponseMessage? response, Exception? exception, out string? errorType)
System\Net\Http\HttpClient.cs (9)
212catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e)) 220catch (Exception e) 288catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e)) 295catch (Exception e) 341catch (Exception e) 485catch (Exception e) 540catch (Exception e) 577private void HandleFailure(Exception e, bool telemetryStarted, HttpResponseMessage? response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts) 581Exception? toThrow = null;
System\Net\Http\HttpContent.cs (15)
325catch (Exception e) when (StreamCopyExceptionNeedsWrapping(e)) 348catch (Exception e) when (StreamCopyExceptionNeedsWrapping(e)) 359catch (Exception e) when (StreamCopyExceptionNeedsWrapping(e)) 382if (!CreateTemporaryBuffer(maxBufferSize, out LimitArrayPoolWriteStream? tempBuffer, out Exception? error)) 403catch (Exception e) 470if (!CreateTemporaryBuffer(maxBufferSize, out LimitArrayPoolWriteStream? tempBuffer, out Exception? error)) 488catch (Exception e) 508catch (Exception e) 511Exception we = GetStreamCopyException(e); 588private bool CreateTemporaryBuffer(long maxBufferSize, out LimitArrayPoolWriteStream? tempBuffer, out Exception? error) 674internal static bool StreamCopyExceptionNeedsWrapping(Exception e) => e is IOException || e is ObjectDisposedException; 676private static Exception GetStreamCopyException(Exception originalException) 692internal static Exception WrapStreamCopyException(Exception e)
System\Net\Http\HttpIOException.cs (1)
19public HttpIOException(HttpRequestError httpRequestError, string? message = null, Exception? innerException = null)
System\Net\Http\HttpMessageInvoker.cs (3)
48catch (Exception ex) when (LogRequestFailed(ex, telemetryStarted: true)) 87catch (Exception ex) when (LogRequestFailed(ex, telemetryStarted: true)) 105internal static bool LogRequestFailed(Exception exception, bool telemetryStarted)
System\Net\Http\HttpProtocolException.cs (1)
27public HttpProtocolException(long errorCode, string message, Exception? innerException)
System\Net\Http\HttpRequestException.cs (4)
17public HttpRequestException(string? message, Exception? inner) 32public HttpRequestException(string? message, Exception? inner, HttpStatusCode? statusCode) 45public HttpRequestException(HttpRequestError httpRequestError, string? message = null, Exception? inner = null, HttpStatusCode? statusCode = null) 66internal HttpRequestException(HttpRequestError httpRequestError, string? message, Exception? inner, RequestRetryType allowRetry)
System\Net\Http\HttpTelemetry.cs (1)
81public void RequestFailed(Exception exception)
System\Net\Http\MessageProcessingHandler.cs (2)
95catch (Exception e) 109catch (Exception e)
System\Net\Http\Metrics\HttpMetricsEnrichmentContext.cs (3)
27private Exception? _exception; 54public Exception? Exception => _exception; 103Exception? exception,
System\Net\Http\Metrics\MetricsHandler.cs (3)
54Exception? exception = null; 62catch (Exception ex) 97private void RequestStop(HttpRequestMessage request, HttpResponseMessage? response, Exception? exception, long startTimestamp, bool recordCurrentRequests)
System\Net\Http\MultipartContent.cs (3)
176catch (Exception ex) 226catch (Exception ex) 299catch (Exception ex)
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (3)
234catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 279catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 430catch (Exception)
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (5)
78catch (Exception e) 133catch (Exception ex) when (ex is not OperationCanceledException) 139internal static Exception CreateWrappedException(Exception exception, string host, int port, CancellationToken cancellationToken) 145static HttpRequestError DeduceError(Exception exception)
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (2)
62catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 123catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken))
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (2)
40public static void StopConnectionSetupActivity(Activity activity, Exception? exception, IPEndPoint? remoteEndPoint) 58public static void ReportError(Activity? activity, Exception exception)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (8)
572Exception? exception = null; 642catch (Exception ex) when (activity is not null) 713catch (Exception ex) 766catch (Exception e) 821catch (Exception e) when (e is not OperationCanceledException) 856private static Exception CreateConnectTimeoutException(OperationCanceledException oce) 861Exception newException = CancellationHelper.CreateOperationCanceledException(te, oce.CancellationToken); 867private static void ThrowGetVersionException(HttpRequestMessage request, int desiredVersion, Exception? inner = null)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (3)
260Exception? connectionException = null; 267catch (Exception e) 306private void HandleHttp11ConnectionFailure(HttpConnectionWaiter<HttpConnection>? requestWaiter, Exception e)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (5)
181Exception? connectionException = null; 219catch (Exception e) 255catch (Exception e) 270private void HandleHttp2ConnectionFailure(HttpConnectionWaiter<Http2Connection?> requestWaiter, Exception e) 354catch (Exception e)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (12)
58private volatile Dictionary<HttpAuthority, Exception?>? _altSvcBlocklist; 81if (!TryGetHttp3Authority(request, out HttpAuthority? authority, out Exception? reasonException)) 99catch (Exception ex) 260Exception? connectionException = null; 268if (TryGetHttp3Authority(queueItem.Request, out authority, out Exception? reasonException)) 287catch (Exception e) 332private void HandleHttp3ConnectionFailure(HttpConnectionWaiter<Http3Connection?> requestWaiter, Exception? e) 616private bool TryGetHttp3Authority(HttpRequestMessage request, [NotNullWhen(true)] out HttpAuthority? authority, out Exception? reasonException) 777private bool IsAltSvcBlocked(HttpAuthority authority, out Exception? reasonException) 803internal void BlocklistAuthority(HttpAuthority badAuthority, Exception? exception = null) 807Dictionary<HttpAuthority, Exception?>? altSvcBlocklist = _altSvcBlocklist; 822altSvcBlocklist = new Dictionary<HttpAuthority, Exception?>();
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (1)
38catch (Exception ex) when (waitForConnectionActivity is not null)
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (2)
87catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 152catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken))
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (16)
73private Exception? _abortException; 238catch (Exception e) 389catch (Exception e) 510catch (Exception e) 607catch (Exception e) 1080Exception resetException = HttpProtocolException.CreateHttp2ConnectionException(errorCode, SR.net_http_http2_connection_close); 1250catch (Exception e) 1271catch (Exception e) 1333catch (Exception e) 1812private void Abort(Exception abortException) 2039catch (Exception e) 2065catch (Exception e) when (e is IOException || e is ObjectDisposedException || e is InvalidOperationException) 2168private static void ThrowRetry(string message, Exception? innerException = null) => 2171private static Exception GetRequestAbortedException(Exception? innerException = null) => 2175private static void ThrowRequestAborted(Exception? innerException = null) =>
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (6)
52private Exception? _resetException; 240catch (Exception e) 942public void OnReset(Exception resetException, Http2ProtocolErrorCode? resetStreamErrorCode = null, bool canRetry = false) 1015if (_resetException is Exception resetException) 1336if (_resetException is Exception resetException) 1565catch (Exception e)
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (9)
47private Exception? _abortException; 53public Exception? AbortException => Volatile.Read(ref _abortException); 161catch (Exception ex) 350internal Exception Abort(Exception abortException) 353Exception? firstException = Interlocked.CompareExchange(ref _abortException, abortException, null); 496catch (Exception ex) 557catch (Exception ex) 692catch (Exception ex)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (7)
289Exception innerException = _connection.AbortException ?? HttpProtocolException.CreateHttp3StreamException(code, ex); 300Exception abortException = _connection.Abort(HttpProtocolException.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close)); 340Exception abortException = _connection.Abort(HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.QPackDecompressionFailed)); 348catch (Exception ex) 1203catch (Exception ex) 1275catch (Exception ex) 1283private void HandleReadResponseContentException(Exception ex, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (9)
153catch (Exception e) when (e is SocketException || e is ObjectDisposedException) 182catch (Exception error) 270catch (Exception error) when (TransitionToCompletedAndTryOwnCompletion()) 842catch (Exception error) 882catch (Exception ex) when (MapSendException(ex, cancellationToken, out Exception mappedEx)) 895if (MapSendException(error, cancellationToken, out Exception mappedException)) 904private bool MapSendException(Exception exception, CancellationToken cancellationToken, out Exception mappedException)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
210Exception? e = task.Exception!.InnerException; // Access Exception even if not tracing, to avoid TaskScheduler.UnobservedTaskException firing
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (1)
403catch (Exception ex)
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
87catch (Exception e)
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (3)
69catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 125catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) 216catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken))
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (3)
600Exception? error = ValidateAndNormalizeRequest(request); 622Exception? error = ValidateAndNormalizeRequest(request); 631private static Exception? ValidateAndNormalizeRequest(HttpRequestMessage request)
System\Net\Http\SocketsHttpHandler\SocksException.cs (1)
12public SocksException(string message, Exception innerException) : base(message, innerException) { }
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
255catch (Exception ex)
System\Net\Http\StreamToStreamCopy.cs (2)
87catch (Exception e) 102catch (Exception e)
System.Net.HttpListener (17)
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
System\Net\HttpListener.cs (3)
164catch (Exception exception) 238catch (Exception exception) 305catch (Exception exception)
System\Net\Managed\ChunkedInputStream.cs (1)
145catch (Exception e)
System\Net\Managed\ChunkStream.cs (2)
280catch (Exception) 293catch (Exception)
System\Net\Managed\HttpConnection.cs (1)
395catch (Exception e)
System\Net\Managed\HttpListener.Managed.cs (5)
48catch (Exception exception) 83catch (Exception exception) 113catch (Exception exception) 139catch (Exception exception) 247Exception exc = new ObjectDisposedException("listener");
System\Net\Managed\HttpStreamAsyncResult.cs (2)
50internal Exception? _error; 58public void Complete(Exception e)
System\Net\Managed\ListenerAsyncResult.Managed.cs (2)
46private Exception? _exception; 61internal void Complete(Exception exc)
System.Net.Mail (62)
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\Mail\MailPriority.cs (3)
245Exception? e = null; 257catch (Exception ex) 323if (castedAsyncResult.Result is Exception e)
System\Net\Mail\SmtpClient.cs (10)
509catch (Exception e) 643catch (Exception e) 659catch (Exception e) 833private void Complete(Exception? exception, object result) 883Exception? exception = result.Result as Exception; 899catch (Exception e) 918catch (Exception e) 936catch (Exception e) 956catch (Exception e)
System\Net\Mail\SmtpCommands.cs (10)
37if (!(multiResult.Result is Exception)) 49if (commandResult is Exception e) 68if (!(multiResult.Result is Exception)) 72catch (Exception e) 90catch (Exception e) 129if (!(multiResult.Result is Exception)) 140if (commandResult is Exception e) 156if (!(multiResult.Result is Exception)) 160catch (Exception e) 178catch (Exception e)
System\Net\Mail\SmtpConnection.cs (10)
415if (connectResult is Exception e) 443catch (Exception e) 462catch (Exception e) 530catch (Exception e) 630catch (Exception e) 661catch (Exception e) 690catch (Exception e) 732catch (Exception e) 818catch (Exception e) 884catch (Exception e)
System\Net\Mail\SmtpException.cs (1)
92public SmtpException(string? message, Exception? innerException) : base(message, innerException)
System\Net\Mail\SmtpFailedRecipientException.cs (2)
25public SmtpFailedRecipientException(string? message, Exception? innerException) : base(message, innerException) { } 44public SmtpFailedRecipientException(string? message, string? failedRecipient, Exception? innerException) : base(message, innerException)
System\Net\Mail\SmtpFailedRecipientsException.cs (1)
27public SmtpFailedRecipientsException(string? message, Exception? innerException) : base(message, innerException)
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
426Exception? exception = null; 436catch (Exception e)
System\Net\Mail\SmtpTransport.cs (5)
134catch (Exception innerException) 276if ((sendMailResult is Exception e) 308catch (Exception e) 363catch (Exception e) 415catch (Exception e)
System\Net\Mime\BaseWriter.cs (3)
127if (!(multiResult.Result is Exception)) 140if (o is Exception e) 185catch (Exception e)
System\Net\Mime\MimeBasePart.cs (2)
218if (castedAsyncResult.Result is Exception) 220throw (Exception)castedAsyncResult.Result;
System\Net\Mime\MimeMultiPart.cs (5)
45internal static void Complete(IAsyncResult result, Exception? e) 62catch (Exception ex) 83catch (Exception e) 109catch (Exception e) 154catch (Exception e)
System\Net\Mime\MimePart.cs (5)
142internal static void Complete(IAsyncResult result, Exception? e) 158catch (Exception ex) 180catch (Exception e) 217catch (Exception e) 282catch (Exception e)
System.Net.NameResolution (12)
System\Net\Dns.cs (8)
27catch (Exception ex) when (LogFailure(string.Empty, activity, ex)) 132Exception? ex = t.Exception?.InnerException; 416catch (Exception ex) when (LogFailure(hostName, activity, ex)) 458catch (Exception ex) when (LogFailure(address, activity, ex)) 488catch (Exception ex) when (LogFailure(name, activity, ex)) 618Exception? exception = null; 625catch (Exception ex) 657private static bool LogFailure(object hostNameOrAddress, in NameResolutionActivity activity, Exception exception)
System\Net\NameResolutionMetrics.cs (1)
29public static void AfterResolution(TimeSpan duration, string hostName, Exception? exception)
System\Net\NameResolutionTelemetry.cs (3)
92public void AfterResolution(object hostNameOrAddress, in NameResolutionActivity activity, object? answer, Exception? exception = null) 145internal static string GetErrorType(Exception exception) => (exception as SocketException)?.SocketErrorCode switch 187public bool Stop(object? answer, Exception? exception, out TimeSpan duration)
System.Net.NetworkInformation (15)
src\libraries\Common\src\System\Net\NetworkInformation\NetworkInformationException.cs (1)
54internal NetworkInformationException(string message, Exception innerException) : base(message, innerException)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\NetworkInformation\LinuxNetworkInterface.cs (1)
60catch (Exception e) when (e is FileNotFoundException || e is UnauthorizedAccessException)
System\Net\NetworkInformation\NetEventSource.NetworkInformation.cs (1)
18public static void Error(Exception exception, [CallerMemberName] string? memberName = null) =>
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (1)
210catch (Exception ex)
System\Net\NetworkInformation\StringParsingHelpers.Misc.cs (4)
21catch (Exception e) 33catch (Exception e) 46catch (Exception e) 52internal static NetworkInformationException CreateNetworkInformationException(Exception inner)
System\Net\NetworkInformation\UnixIPGlobalProperties.cs (5)
61internal List<Exception>? _exceptions; 63internal void AddException(Exception e) 65_exceptions ??= new List<Exception>(); 82catch (Exception e) 100catch (Exception e)
System.Net.Ping (7)
System\Net\NetworkInformation\Ping.cs (3)
409catch (Exception e) when (e is not PlatformNotSupportedException) 694catch (Exception e) when (e is not PlatformNotSupportedException) 727catch (Exception e) when (e is not PlatformNotSupportedException && !(e is OperationCanceledException && _canceled))
System\Net\NetworkInformation\Ping.PingUtility.cs (2)
66catch (Exception) 101catch (Exception e)
System\Net\NetworkInformation\PingCompletedEventArgs.cs (1)
12internal PingCompletedEventArgs(PingReply? reply, Exception? error, bool cancelled, object? userToken) : base(error, cancelled, userToken)
System\Net\NetworkInformation\PingException.cs (1)
18public PingException(string? message, Exception? innerException) :
System.Net.Primitives (5)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\CookieContainer.cs (2)
341catch (Exception e) 743catch (Exception e)
System\Net\CookieException.cs (1)
31public CookieException(string? message, Exception? innerException) : base(message, innerException)
System.Net.Quic (42)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (2)
47internal static Exception CreateOpenSslCryptographicException() 94Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs (1)
152Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (1)
32catch (Exception ex)
System\Net\Quic\Internal\MsQuicTlsSecret.cs (1)
33catch (Exception ex)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (7)
55/// Returns <c>true</c> is this task source has entered its final state, i.e. <see cref="TrySetResult(bool)"/> or <see cref="TrySetException(Exception, bool)"/> 134private bool TryComplete(Exception? exception, bool final) 235public bool TrySetException(Exception exception, bool final = false) 268if (_finalTaskSource.TrySignal(out Exception? exception)) 299private Exception? _exception; 333public bool TryComplete(Exception? exception = null) 345public bool TrySignal(out Exception? exception)
System\Net\Quic\Internal\ThrowHelper.cs (5)
33internal static bool TryGetStreamExceptionForMsQuicStatus(int status, [NotNullWhen(true)] out Exception? exception) 57internal static Exception GetExceptionForMsQuicStatus(int status, long? errorCode = default, string? message = null) 59Exception ex = GetExceptionInternal(status, errorCode, message); 68static Exception GetExceptionInternal(int status, long? errorCode, string? message) 236Exception? e = task.Exception!.InnerException;
System\Net\Quic\Internal\ValueTaskSource.cs (3)
39/// Returns <c>true</c> is this task source was completed, i.e. <see cref="TrySetResult"/> or <see cref="TrySetException(Exception)"/> was called. 96private bool TryComplete(Exception? exception) 164public bool TrySetException(Exception exception)
System\Net\Quic\QuicConnection.cs (6)
265catch (Exception ex) 539catch (Exception ex) 659Exception exception = ExceptionDispatchInfo.SetCurrentStackTrace(ThrowHelper.GetExceptionForMsQuicStatus(data.Status, (long)data.ErrorCode)); 667Exception exception = ExceptionDispatchInfo.SetCurrentStackTrace(ThrowHelper.GetConnectionAbortedException((long)data.ErrorCode)); 677Exception exception = ExceptionDispatchInfo.SetCurrentStackTrace(_disposed ? new ObjectDisposedException(GetType().FullName) : ThrowHelper.GetOperationAbortedException()); 798catch (Exception ex)
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
138catch (Exception ex) 251catch (Exception ex)
System\Net\Quic\QuicException.cs (2)
41internal QuicException(QuicError error, long? applicationErrorCode, string message, Exception? innerException) 53internal QuicException(QuicError error, long? applicationErrorCode, long? transportErrorCode, string message, Exception? innerException)
System\Net\Quic\QuicListener.cs (6)
97/// Incoming connections waiting to be accepted via AcceptAsync. The item will either be fully connected <see cref="QuicConnection"/> or <see cref="Exception"/> if the handshake failed. 190ExceptionDispatchInfo.Throw((Exception)item); 276Exception ex = ExceptionDispatchInfo.SetCurrentStackTrace(new QuicException(QuicError.ConnectionTimeout, null, SR.Format(SR.net_quic_handshake_timeout, handshakeTimeout), oce)); 283catch (Exception ex) 300if (task.AsTask().Exception?.InnerException is Exception handshakeException) 392catch (Exception ex)
System\Net\Quic\QuicStream.cs (6)
114private Exception? _sendException; 426if (ThrowHelper.TryGetStreamExceptionForMsQuicStatus(status, out Exception? exception)) 552if (ThrowHelper.TryGetStreamExceptionForMsQuicStatus(data.Status, out Exception? exception)) 585Exception? exception = Volatile.Read(ref _sendException); 630Exception exception = (shutdownByApp, closedRemotely) switch 696catch (Exception ex)
System.Net.Requests (57)
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\CommandStream.cs (10)
45internal virtual void Abort(Exception e) 133protected static Exception GenerateException(string message, WebExceptionStatus status, Exception? innerException) 142protected static Exception GenerateException(FtpStatusCode code, string? statusDescription, Exception? innerException) 170catch (Exception e) 315Exception exception; 429catch (Exception e) 458catch (Exception e) 542catch (Exception e)
System\Net\FileWebRequest.cs (2)
154catch (Exception e) { throw new WebException(e.Message, e); } 212catch (Exception e)
System\Net\FileWebResponse.cs (1)
43catch (Exception e)
System\Net\FtpControlStream.cs (5)
119catch (Exception e) 141catch (Exception e) 156catch (Exception e) 414catch (Exception e) 1139catch (Exception e)
System\Net\FtpDataStream.cs (3)
90catch (Exception exception) 263catch (Exception exception) 295if (result is Exception e)
System\Net\FtpWebRequest.cs (24)
209private Exception? _exception; 584catch (Exception exception) 668catch (Exception exception) 700catch (Exception exception) 753catch (Exception exception) 792catch (Exception exception) 832catch (Exception exception) 892catch (Exception e) 929catch (Exception exception) 935private static Exception TranslateConnectException(Exception e) 962catch (Exception e) 981catch (Exception e) 1005catch (Exception exception) 1059private bool AttemptedRecovery(Exception e) 1091private void SetException(Exception exception) 1157Exception? exception = obj as Exception; 1185catch (Exception exception) 1207Exception? exception = obj as Exception; 1249catch (Exception e) 1295catch (Exception exception) 1453catch (Exception exception)
System\Net\HttpWebRequest.cs (3)
1058catch (Exception ex) 1160catch (Exception ex) 1431catch (Exception ex)
System\Net\TimerThread.cs (2)
422catch (Exception exception) 586catch (Exception exception)
System\Net\WebException.cs (4)
31public WebException(string? message, Exception? innerException) : 42Exception? innerException, 80internal static Exception CreateCompatibleException(Exception exception)
System.Net.Security (45)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (2)
47internal static Exception CreateOpenSslCryptographicException() 94Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (6)
524Exception? handshakeException = null; 545Exception? innerError = GetSslError(retVal, errorCode); 561catch (Exception) when (handshakeException != null) 865private static Exception? GetSslError(int result, Ssl.SslErrorCode retVal) 867Exception? innerError; 942public SslException(string? inputMessage, Exception? ex)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
406catch (Exception exc)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs (1)
152Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (1)
32catch (Exception ex)
src\libraries\Common\src\System\Net\Security\SSPIHandleCache.cs (1)
32catch (Exception e)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Net\CertificateValidationPal.cs (1)
72catch (Exception exception)
System\Net\NegotiateAuthenticationPal.Unix.cs (5)
144catch (Exception ex) 509catch (Exception ex) when (ex is not Interop.NetSecurityNative.GssApiException) 664catch (Exception ex) 736catch (Exception ex) 781catch (Exception e) when (e is EntryPointNotFoundException || e is DllNotFoundException || e is TypeInitializationException)
System\Net\Security\AuthenticatedStream.cs (1)
79catch (Exception exc)
System\Net\Security\NegotiateStream.cs (7)
438catch (Exception e) when (!(e is IOException || e is OperationCanceledException)) 552catch (Exception e) when (!(e is IOException || e is OperationCanceledException)) 701private void SetFailed(Exception e) 738catch (Exception e) 766Exception exception = statusCode switch 831Exception exception = statusCode switch 919private async Task SendAuthResetSignalAndThrowAsync<TIOAdapter>(byte[] message, Exception exception, CancellationToken cancellationToken)
System\Net\Security\NetSecurityTelemetry.cs (1)
331public static void StopActivity(Activity? activity, Exception? exception, SslStream stream)
System\Net\Security\SslStream.IO.cs (5)
44private void SetException(Exception e) 139Exception? exception = null; 157catch (Exception ex) 943catch (Exception e) 982catch (Exception e)
System\Net\Security\SslStream.Protocol.cs (1)
1413internal Exception? GetException()
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
366catch (Exception ex)
System\Net\Security\SslStreamPal.Unix.cs (4)
15public static Exception GetException(SecurityStatusPal status) 72catch (Exception ex) 99catch (Exception ex) 232catch (Exception exc)
System\Net\SecurityStatusPal.cs (2)
9public readonly Exception? Exception; 11public SecurityStatusPal(SecurityStatusPalErrorCode errorCode, Exception? exception = null)
System\Security\Authentication\AuthenticationException.cs (2)
22public AuthenticationException(string? message, Exception? innerException) : base(message, innerException) { } 46public InvalidCredentialException(string? message, Exception? innerException) : base(message, innerException) { }
System.Net.Sockets (41)
src\libraries\Common\src\System\Net\ExceptionCheck.cs (1)
8internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
System\Net\Sockets\NetworkStream.cs (13)
242catch (Exception exception) when (!(exception is OutOfMemoryException)) 267catch (Exception exception) when (!(exception is OutOfMemoryException)) 314catch (Exception exception) when (!(exception is OutOfMemoryException)) 340catch (Exception exception) when (!(exception is OutOfMemoryException)) 454catch (Exception exception) when (!(exception is OutOfMemoryException)) 479catch (Exception exception) when (!(exception is OutOfMemoryException)) 521catch (Exception exception) when (!(exception is OutOfMemoryException)) 542catch (Exception exception) when (!(exception is OutOfMemoryException)) 580catch (Exception exception) when (!(exception is OutOfMemoryException)) 603catch (Exception exception) when (!(exception is OutOfMemoryException)) 640catch (Exception exception) when (!(exception is OutOfMemoryException)) 662catch (Exception exception) when (!(exception is OutOfMemoryException)) 719private static IOException WrapException(string resourceFormatString, Exception innerException)
System\Net\Sockets\SafeSocketHandle.cs (2)
125catch (Exception exception) when (!ExceptionCheck.IsFatal(exception)) 156catch (Exception exception)
System\Net\Sockets\Socket.cs (8)
967catch (Exception ex) when (!ExceptionCheck.IsFatal(ex)) 1070catch (Exception ex) 2867catch (Exception ex) 2952catch (Exception ex) 2969catch (Exception ex) 3239catch (Exception) 3359catch (Exception ex) 3398catch (Exception exception) when (!ExceptionCheck.IsFatal(exception)) { }
System\Net\Sockets\Socket.Tasks.cs (6)
193Exception? lastException = null; 212catch (Exception ex) when (ex is not OperationCanceledException) 923private static Exception GetException(SocketError error, bool wrapExceptionsInIOExceptions = false) 925Exception e = ExceptionDispatchInfo.SetCurrentStackTrace(new SocketException((int)error)); 1389private Exception CreateException(SocketError error, bool forAsyncThrow = true) 1391Exception e = new SocketException((int)error);
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
245catch (Exception e)
System\Net\Sockets\SocketAsyncEventArgs.cs (5)
56private Exception? _connectByNameError; 293public Exception? ConnectByNameError 439internal void SetResults(Exception exception, int bytesTransferred, SocketFlags flags) 712Exception? caughtException = null; 806catch (Exception exc)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
263catch (Exception exc)
System\Net\Sockets\SocketPal.Unix.cs (1)
2138catch (Exception exc)
System\Net\Sockets\UDPClient.cs (3)
704Exception? lastex = null; 758catch (Exception ex) 769catch (Exception ex)
System.Net.WebClient (47)
src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (1)
94public void SetException(Exception exception)
System\Net\WebClient.cs (46)
308catch (Exception e) when (!(e is OutOfMemoryException)) 338catch (Exception e) when (!(e is OutOfMemoryException)) 373catch (Exception e) when (!(e is OutOfMemoryException)) 411catch (Exception e) when (!(e is OutOfMemoryException)) 463catch (Exception e) when (!(e is OutOfMemoryException)) 576catch (Exception e) 643catch (Exception e) when (!(e is OutOfMemoryException)) 708catch (Exception exception) when (!(exception is OutOfMemoryException)) { } 858catch (Exception e) when (!(e is OutOfMemoryException)) 869AsyncOperation asyncOp, Action<byte[]?, Exception?, AsyncOperation> completionDelegate) 874Exception? exception = null; 928catch (Exception e) when (!(e is OutOfMemoryException)) 996catch (Exception e) when (!(e is OutOfMemoryException)) 1007AsyncOperation asyncOp, Action<byte[]?, Exception?, AsyncOperation> completionDelegate) 1013Exception? exception = null; 1071catch (Exception e) when (!(e is OutOfMemoryException)) 1100catch (Exception e) when (e is NotImplementedException || e is NotSupportedException) // some types do this 1204Exception? exception = null; 1210catch (Exception e) when (!(e is OutOfMemoryException)) 1218catch (Exception e) when (!(e is OutOfMemoryException)) 1245Exception? exception = null; 1251catch (Exception e) when (!(e is OutOfMemoryException)) 1259catch (Exception e) when (!(e is OutOfMemoryException)) 1266private void DownloadStringAsyncCallback(byte[]? returnBytes, Exception? exception, object state) 1277catch (Exception e) when (!(e is OutOfMemoryException)) 1300catch (Exception e) when (!(e is OutOfMemoryException)) 1306private void DownloadDataAsyncCallback(byte[]? returnBytes, Exception? exception, object state) 1326catch (Exception e) when (!(e is OutOfMemoryException)) 1332private void DownloadFileAsyncCallback(byte[]? returnBytes, Exception? exception, object state) 1355catch (Exception e) when (!(e is OutOfMemoryException)) 1394catch (Exception e) when (!(e is OutOfMemoryException)) 1404catch (Exception e) when (!(e is OutOfMemoryException)) 1443catch (Exception e) when (!(e is OutOfMemoryException)) 1479catch (Exception e) when (!(e is OutOfMemoryException)) 1519catch (Exception e) when (!(e is OutOfMemoryException)) 1526private static Exception GetExceptionToPropagate(Exception e) => 1914internal OpenReadCompletedEventArgs(Stream? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 1933internal OpenWriteCompletedEventArgs(Stream? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 1952internal DownloadStringCompletedEventArgs(string? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 1972internal DownloadDataCompletedEventArgs(byte[]? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 1991internal UploadStringCompletedEventArgs(string? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 2010internal UploadDataCompletedEventArgs(byte[]? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 2029internal UploadFileCompletedEventArgs(byte[]? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 2048internal UploadValuesCompletedEventArgs(byte[]? result, Exception? exception, bool cancelled, object? userToken) : base(exception, cancelled, userToken) 2104public Exception? Error { get { return null; } }
System.Net.WebSockets (30)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (1)
219catch (Exception cause)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
265catch (Exception exception)
System\Net\WebSockets\ManagedWebSocket.cs (13)
333catch (Exception exc) 375catch (Exception exc) 392catch (Exception exc) 409catch (Exception exc) 542catch (Exception exc) 579catch (Exception exc) 619catch (Exception exc) 1009catch (Exception exc) 1020Exception inner = exc; 1275WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null) 1502catch (Exception exc) 1723private static OperationCanceledException CreateOperationCanceledException(Exception innerException, CancellationToken cancellationToken = default(CancellationToken)) 1737Exception? keepAliveException = null;
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (6)
81Exception exc = ExceptionDispatchInfo.SetCurrentStackTrace( 105catch (Exception e) 165Exception e = task.Exception!.InnerException!; 187internal Exception? Exception { get; private set; } 243internal void OnKeepAliveFaulted(Exception exc) 251internal void OnKeepAliveFaultedCore(Exception exc)
System\Net\WebSockets\NetEventSource.WebSockets.cs (2)
83public static void TraceErrorMsg(object? obj, Exception exception, [CallerMemberName] string? memberName = null) 87public static void TraceException(object? obj, Exception exception, [CallerMemberName] string? memberName = null)
System\Net\WebSockets\WebSocketException.cs (6)
32public WebSocketException(WebSocketError error, Exception? innerException) 37public WebSocketException(WebSocketError error, string? message, Exception? innerException) 57public WebSocketException(int nativeError, Exception? innerException) 76public WebSocketException(WebSocketError error, int nativeError, Exception? innerException) 81public WebSocketException(WebSocketError error, int nativeError, string? message, Exception? innerException) 93public WebSocketException(string? message, Exception? innerException)
System\Net\WebSockets\WebSocketStateHelper.cs (1)
21internal static void ThrowIfInvalidState(WebSocketState currentState, bool isDisposed, Exception? innerException, ManagedWebSocketStates validStates)
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
206catch (Exception exc)
System.Private.CoreLib (483)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (3)
296internal static Exception GetClasslibException(ExceptionIDs id, IntPtr address) 315Exception? e = id switch 573Exception? exceptionToThrow = null;
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
170catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 114internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string? path = null, bool isDirError = false) 139Exception inner = GetIOException(errorInfo); 179internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MountPoints.cs (1)
31catch (Exception e)
src\libraries\Common\src\System\IO\Win32Marshal.cs (4)
15/// Converts, resetting it, the last Win32 error into a corresponding <see cref="Exception"/> object, optionally 18internal static Exception GetExceptionForLastWin32Error(string? path = "") 22/// Converts the specified Win32 error into a corresponding <see cref="Exception"/> object, optionally 25internal static Exception GetExceptionForWin32Error(int errorCode, string? path = "", string? errorDetails = null)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (5)
92catch (Exception e) 127catch (Exception e) 205catch (Exception e) 245catch (Exception e) 273catch (Exception e)
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (2)
85Exception? exception = null; 115catch (Exception e)
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (6)
92Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException) 110if (createOpenException?.Invoke(error, flags, path) is Exception ex) 185Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 191Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 198Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null) 229catch (Exception)
src\libraries\System.Private.CoreLib\src\System\AccessViolationException.cs (1)
29public AccessViolationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (33)
26private readonly Exception[] _innerExceptions; // Complete set of exceptions. 27private ReadOnlyCollection<Exception>? _rocView; // separate from _innerExceptions to enable trimming if InnerExceptions isn't used 45_innerExceptions = Array.Empty<Exception>(); 56public AggregateException(string? message, Exception innerException) 73public AggregateException(IEnumerable<Exception> innerExceptions) : 87public AggregateException(params Exception[] innerExceptions) : 102public AggregateException(string? message, IEnumerable<Exception> innerExceptions) 103: this(message, new List<Exception>(innerExceptions ?? throw new ArgumentNullException(nameof(innerExceptions))).ToArray(), cloneExceptions: false) 117public AggregateException(string? message, params Exception[] innerExceptions) : 122private AggregateException(string? message, Exception[] innerExceptions, bool cloneExceptions) : 125_innerExceptions = cloneExceptions ? new Exception[innerExceptions.Length] : innerExceptions; 170_innerExceptions = new Exception[innerExceptionInfos.Count]; 193_innerExceptions = info.GetValue("InnerExceptions", typeof(Exception[])) as Exception[] ?? // Do not rename (binary serialization); 212info.AddValue("InnerExceptions", _innerExceptions, typeof(Exception[])); // Do not rename (binary serialization) 216/// Returns the <see cref="Exception"/> that is the root cause of this exception. 222public override Exception GetBaseException() 226Exception? back = this; 237/// Gets a read-only collection of the <see cref="Exception"/> instances that caused the 240public ReadOnlyCollection<Exception> InnerExceptions => _rocView ??= new ReadOnlyCollection<Exception>(_innerExceptions); 244/// Invokes a handler on each <see cref="Exception"/> contained by this <see 248/// argument the <see cref="Exception"/> to be processed and returns a Boolean to indicate 252/// <see cref="Exception"/> was handled. After all invocations, if any exceptions went 262public void Handle(Func<Exception, bool> predicate) 266List<Exception>? unhandledExceptions = null; 273unhandledExceptions ??= new List<Exception>(); 287/// Flattens the inner instances of <see cref="AggregateException"/> by expanding its contained <see cref="Exception"/> instances 301List<Exception> flattenedExceptions = new List<Exception>(); 311ReadOnlyCollection<Exception> currentInnerExceptions = exceptionsToFlatten[nDequeueIndex++].InnerExceptions; 315Exception currentInnerException = currentInnerExceptions[i]; 397internal Exception[] InternalInnerExceptions => _innerExceptions;
src\libraries\System.Private.CoreLib\src\System\AppDomainUnloadedException.cs (1)
26public AppDomainUnloadedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ApplicationException.cs (2)
14/// You should derive custom exceptions from the <see cref="Exception" /> class rather than the <see cref="ApplicationException" /> class. 41public ApplicationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ArgumentException.cs (2)
37public ArgumentException(string? message, Exception? innerException) 43public ArgumentException(string? message, string? paramName, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ArgumentNullException.cs (1)
33public ArgumentNullException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ArgumentOutOfRangeException.cs (1)
42public ArgumentOutOfRangeException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ArithmeticException.cs (1)
36public ArithmeticException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Array.cs (4)
872catch (Exception e) 966catch (Exception e) 2306catch (Exception e) 2523catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\ArrayTypeMismatchException.cs (1)
36public ArrayTypeMismatchException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\BadImageFormatException.cs (2)
33public BadImageFormatException(string? message, Exception? inner) 45public BadImageFormatException(string? message, string? fileName, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\CannotUnloadAppDomainException.cs (1)
26public CannotUnloadAppDomainException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (7)
32catch (Exception e) 45catch (Exception e) 67catch (Exception e) 318catch (Exception e) 340catch (Exception e) 627catch (Exception e) 870catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\KeyNotFoundException.cs (1)
26public KeyNotFoundException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ComponentModel\Win32Exception.cs (4)
56public Win32Exception(string? message, Exception? innerException) : base(message, innerException) 82/// Returns a string that contains the <see cref="NativeErrorCode"/>, or <see cref="Exception.HResult"/>, or both. 84/// <returns>A string that represents the <see cref="NativeErrorCode"/>, or <see cref="Exception.HResult"/>, or both.</returns> 113Exception? innerException = InnerException;
src\libraries\System.Private.CoreLib\src\System\Context.cs (1)
27public ContextMarshalException(string? message, Exception? inner) : base(message, inner)
src\libraries\System.Private.CoreLib\src\System\DataMisalignedException.cs (1)
29public DataMisalignedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractException.cs (1)
29public ContractException(ContractFailureKind kind, string? failure, string? userMessage, string? condition, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractFailedEventArgs.cs (4)
11private readonly Exception? _originalException; 15internal Exception? thrownDuringHandler; 17public ContractFailedEventArgs(ContractFailureKind failureKind, string? message, string? condition, Exception? originalException) 29public Exception? OriginalException => _originalException;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\Contracts.cs (5)
330public static void Requires<TException>(bool condition) where TException : Exception 346public static void Requires<TException>(bool condition, string? userMessage) where TException : Exception 400public static void EnsuresOnThrow<TException>(bool condition) where TException : Exception 418public static void EnsuresOnThrow<TException>(bool condition, string? userMessage) where TException : Exception 651private static void ReportFailure(ContractFailureKind failureKind, string? userMessage, string? conditionText, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debugger.cs (1)
17public static void BreakForUserUnhandledException(Exception exception)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (4)
81public StackTrace(Exception e) 91public StackTrace(Exception e, bool fNeedFileInfo) 102public StackTrace(Exception e, int skipFrames) 115public StackTrace(Exception e, int skipFrames, bool fNeedFileInfo)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (12)
254private Exception? m_constructionException; // If there was an exception construction, this is it 524public Exception? ConstructionException => m_constructionException; 1441catch (Exception ex) 1719catch (Exception e) 2071catch (Exception ex) 2183Exception? lastThrownException = null; 2194catch (Exception e) 2399private void ThrowEventSourceException(string? eventName, Exception? innerEx = null) 2801catch (Exception e) 3141Exception? exception = null; // exception that might get raised during validation b/c we couldn't/didn't recover from a previous error 3415catch (Exception e) 3984catch (Exception)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSourceException.cs (2)
31public EventSourceException(string? message, Exception? innerException) : base(message ?? SR.EventSource_ListenerWriteFailure, innerException) { } 40internal EventSourceException(Exception? innerException) :
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\IncrementingPollingCounter.cs (1)
58catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\PollingCounter.cs (1)
54catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (1)
106_exceptionCounter ??= new IncrementingPollingCounter("exception-count", this, () => Exception.GetExceptionCount()) { DisplayName = "Exception Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (2)
675catch (Exception ex) 689catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (2)
38catch (Exception) { } 191catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\UnreachableException.cs (1)
36public UnreachableException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\DivideByZeroException.cs (1)
29public DivideByZeroException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\DllNotFoundException.cs (1)
29public DllNotFoundException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\DuplicateWaitObjectException.cs (1)
37public DuplicateWaitObjectException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\EntryPointNotFoundException.cs (1)
29public EntryPointNotFoundException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (2)
70catch (Exception exc) 238catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\Exception.cs (8)
36public Exception(string? message, Exception? innerException) 51_innerException = (Exception?)(info.GetValue("InnerException", typeof(Exception))); // Do not rename (binary serialization) 69public virtual Exception GetBaseException() 71Exception? inner = InnerException; 72Exception back = this; 83public Exception? InnerException => _innerException; 113info.AddValue("InnerException", _innerException, typeof(Exception)); // Do not rename (binary serialization)
src\libraries\System.Private.CoreLib\src\System\ExecutionEngineException.cs (1)
29public ExecutionEngineException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\FieldAccessException.cs (1)
29public FieldAccessException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\FormatException.cs (1)
29public FormatException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (1)
461catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (2)
78catch (Exception) 105catch (Exception)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (3)
363catch (Exception) 378catch (Exception) 399catch (Exception)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureNotFoundException.cs (3)
32public CultureNotFoundException(string? message, Exception? innerException) 43public CultureNotFoundException(string? message, string? invalidCultureName, Exception? innerException) 49public CultureNotFoundException(string? message, int invalidCultureId, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (1)
5153private static Exception GetDateTimeParseException(scoped ref DateTimeResult result)
src\libraries\System.Private.CoreLib\src\System\IndexOutOfRangeException.cs (1)
28public IndexOutOfRangeException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\InsufficientExecutionStackException.cs (1)
25public InsufficientExecutionStackException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\InsufficientMemoryException.cs (1)
32public InsufficientMemoryException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\InvalidCastException.cs (1)
29public InvalidCastException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\InvalidOperationException.cs (1)
29public InvalidOperationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\InvalidProgramException.cs (1)
29public InvalidProgramException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\InvalidTimeZoneException.cs (1)
23public InvalidTimeZoneException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (1)
105catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (3)
458private int ReadFromBuffer(byte[] buffer, int offset, int count, out Exception? error) 465catch (Exception ex) 595Exception? error;
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryNotFoundException.cs (1)
32public DirectoryNotFoundException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\EndOfStreamException.cs (1)
26public EndOfStreamException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1344catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\IO\FileLoadException.cs (2)
26public FileLoadException(string? message, Exception? inner) 38public FileLoadException(string? message, string? fileName, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (2)
28public FileNotFoundException(string? message, Exception? innerException) 41public FileNotFoundException(string? message, string? fileName, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (4)
54private static Exception? CreateOpenExceptionForCopyFile(Interop.ErrorInfo error, Interop.Sys.OpenFlags flags, string path) 480Exception? firstException = null; 506catch (Exception ex) 512catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\IO\InvalidDataException.cs (7)
16/// <remarks>This constructor initializes the <see cref="Exception.Message" /> property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message is localized based on the current system culture.</remarks> 24/// <remarks>This constructor initializes the <see cref="Exception.Message" /> property of the new instance to a system-supplied message that describes the error, such as "An invalid argument was specified." This message is localized based on the current system culture.</remarks> 33/// <remarks>This constructor initializes the <see cref="Exception.Message" /> property of the new instance using the value of the <paramref name="message" /> parameter. The content of the <paramref name="message" /> parameter is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. 34/// An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the <see cref="Exception.InnerException" /> property. The <see cref="Exception.InnerException" /> property returns the same value that is passed into the constructor, or <see langword="null" /> if the <see cref="Exception.InnerException" /> property does not supply the inner exception value to the constructor.</remarks> 35public InvalidDataException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\IOException.cs (1)
32public IOException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (6)
173catch (Exception ex) 384catch (Exception exception) 420catch (Exception exception) 505catch (Exception ex) 679catch (Exception exception) 710catch (Exception exception)
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (1)
105catch (Exception ex) when (ex is ArgumentException or IOException or UnauthorizedAccessException)
src\libraries\System.Private.CoreLib\src\System\IO\PathTooLongException.cs (1)
26public PathTooLongException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (1)
128catch (Exception e) when (!disposing && FileStreamHelpers.IsIoRelatedException(e))
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamHelpers.cs (1)
43internal static bool IsIoRelatedException(Exception e) =>
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (1)
181catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (1)
76catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (5)
243catch (Exception ex) 433catch (Exception ex) 471catch (Exception ex) 710catch (Exception ex) 743catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\IObserver.cs (1)
9void OnError(Exception error);
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (2)
66internal LazyHelper(LazyThreadSafetyMode mode, Exception exception) 324catch (Exception exception)
src\libraries\System.Private.CoreLib\src\System\MemberAccessException.cs (1)
41public MemberAccessException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\MethodAccessException.cs (1)
29public MethodAccessException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\MissingFieldException.cs (1)
26public MissingFieldException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\MissingMemberException.cs (1)
26public MissingMemberException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\MissingMethodException.cs (1)
29public MissingMethodException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\MulticastNotSupportedException.cs (1)
30public MulticastNotSupportedException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\NotFiniteNumberException.cs (2)
43public NotFiniteNumberException(string? message, Exception? innerException) 49public NotFiniteNumberException(string? message, double offendingNumber, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\NotImplementedException.cs (1)
27public NotImplementedException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\NotSupportedException.cs (1)
30public NotSupportedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\NullReferenceException.cs (1)
29public NullReferenceException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\ObjectDisposedException.cs (1)
38public ObjectDisposedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\OperationCanceledException.cs (2)
39public OperationCanceledException(string? message, Exception? innerException) 58public OperationCanceledException(string? message, Exception? innerException, CancellationToken token)
src\libraries\System.Private.CoreLib\src\System\OutOfMemoryException.cs (1)
28public OutOfMemoryException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\OverflowException.cs (1)
29public OverflowException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\PlatformNotSupportedException.cs (1)
29public PlatformNotSupportedException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\RankException.cs (1)
29public RankException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Reflection\AmbiguousMatchException.cs (1)
25public AmbiguousMatchException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeFormatException.cs (1)
24public CustomAttributeFormatException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\ILGenerator.cs (2)
94if (!excType.IsSubclassOf(typeof(Exception)) && excType != typeof(Exception))
src\libraries\System.Private.CoreLib\src\System\Reflection\InvalidFilterCriteriaException.cs (1)
24public InvalidFilterCriteriaException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (2)
53catch (Exception e) when (wrapInTargetInvocationException) 75catch (Exception e) when (wrapInTargetInvocationException)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (7)
59catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 97catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 138catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 176catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 219catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 264catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) 305catch (Exception e) when ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (10)
15public ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions) : 20public ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions, string? message) 24LoaderExceptions = exceptions ?? Array.Empty<Exception>(); 33LoaderExceptions = (Exception?[]?)info.GetValue("Exceptions", typeof(Exception[])) ?? Array.Empty<Exception?>(); 42info.AddValue("Exceptions", LoaderExceptions, typeof(Exception[])); 47public Exception?[] LoaderExceptions { get; } 57Exception?[] exceptions = LoaderExceptions; 64foreach (Exception? e in exceptions)
src\libraries\System.Private.CoreLib\src\System\Reflection\TargetException.cs (1)
24public TargetException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Reflection\TargetInvocationException.cs (2)
13public TargetInvocationException(Exception? inner) 19public TargetInvocationException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Reflection\TargetParameterCountException.cs (1)
25public TargetParameterCountException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Resources\MissingManifestResourceException.cs (1)
27public MissingManifestResourceException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Resources\MissingSatelliteAssemblyException.cs (1)
38public MissingSatelliteAssemblyException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\AmbiguousImplementationException.cs (1)
25public AmbiguousImplementationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (2)
115/// <param name="exception">The <see cref="Exception"/> to use to fault the task.</param> 119public void SetException(Exception exception) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (6)
66catch (Exception e) 122catch (Exception e) 141catch (Exception e) 504/// <param name="exception">The <see cref="Exception"/> to use to fault the task.</param> 507public void SetException(Exception exception) => SetException(exception, ref m_task); 509internal static void SetException(Exception exception, ref Task<TResult>? taskField)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncValueTaskMethodBuilder.cs (1)
53public void SetException(Exception exception) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncValueTaskMethodBuilderT.cs (1)
60public void SetException(Exception exception) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (2)
111public void SetException(Exception exception) 157catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ContractHelper.cs (3)
33public static string? RaiseContractFailedEvent(ContractFailureKind failureKind, string? userMessage, string? conditionText, Exception? innerException) 55catch (Exception e) 88public static void TriggerFailure(ContractFailureKind kind, string? displayMessage, string? userMessage, string? conditionText, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilder.cs (1)
55public void SetException(Exception exception) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (4)
65public void SetException(Exception exception) => 68internal static void SetException(Exception exception, [NotNull] ref StateMachineBox? boxFieldRef) 120catch (Exception e) 253public void SetException(Exception error) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\SwitchExpressionException.cs (2)
21public SwitchExpressionException(Exception? innerException) : 40public SwitchExpressionException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (4)
64/// <exception cref="Exception">The task completed in a Faulted state.</exception> 331/// <exception cref="Exception">The task completed in a Faulted state.</exception> 428/// <exception cref="Exception">The task completed in a Faulted state.</exception> 511/// <exception cref="Exception">The task completed in a Faulted state.</exception>
src\libraries\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs (17)
18private readonly Exception _exception; 19private readonly Exception.DispatchState _dispatchState; 21private ExceptionDispatchInfo(Exception exception) 30public static ExceptionDispatchInfo Capture(Exception source) 38public Exception SourceException => _exception; 60public static void Throw(Exception source) => Capture(source).Throw(); 62/// <summary>Stores the current stack trace into the specified <see cref="Exception"/> instance.</summary> 63/// <param name="source">The unthrown <see cref="Exception"/> instance.</param> 68public static Exception SetCurrentStackTrace(Exception source) 78/// Stores the provided stack trace into the specified <see cref="Exception"/> instance. 80/// <param name="source">The unthrown <see cref="Exception"/> instance.</param> 82/// from the <see cref="Exception.StackTrace"/> property from the remote exception instance.</param> 87/// This method populates the <see cref="Exception.StackTrace"/> property from an arbitrary string value. 88/// The typical use case is the transmission of <see cref="Exception"/> objects across processes with high fidelity, 95public static Exception SetRemoteStackTrace(Exception source, string stackTrace)
src\libraries\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionHandling.cs (3)
10private static Func<Exception, bool>? s_handler; 12internal static bool IsHandledByGlobalHandler(Exception ex) 22public static void SetUnhandledExceptionHandler(Func<Exception, bool> handler)
src\libraries\System.Private.CoreLib\src\System\Runtime\ExceptionServices\FirstChanceExceptionEventArgs.cs (2)
9public FirstChanceExceptionEventArgs(Exception exception) 15public Exception Exception { get; }
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\COMException.cs (2)
32public COMException(string? message, Exception? inner) 62Exception? innerException = InnerException;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ErrorWrapper.cs (1)
24public ErrorWrapper(Exception e)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ExternalException.cs (2)
29public ExternalException(string? message, Exception? inner) 61Exception? innerException = InnerException;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\InvalidComObjectException.cs (1)
31public InvalidComObjectException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\InvalidOleVariantTypeException.cs (1)
30public InvalidOleVariantTypeException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
644public static Exception? GetExceptionForHR(int errorCode) => GetExceptionForHR(errorCode, IntPtr.Zero); 646public static Exception? GetExceptionForHR(int errorCode, IntPtr errorInfo)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.NoCom.cs (1)
16public static int GetHRForException(Exception? e)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MarshalDirectiveException.cs (1)
29public MarshalDirectiveException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ObjectiveC\ObjectiveCMarshal.PlatformNotSupported.cs (2)
34Exception exception, 142public static void SetMessageSendPendingException(Exception? exception)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeArrayRankMismatchException.cs (1)
30public SafeArrayRankMismatchException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeArrayTypeMismatchException.cs (1)
30public SafeArrayTypeMismatchException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SEHException.cs (1)
28public SEHException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationException.cs (1)
29public SerializationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
171catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\Security\CryptographicException.cs (1)
31public CryptographicException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Security\SecurityException.cs (1)
34public SecurityException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\Security\VerificationException.cs (1)
26public VerificationException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\StackOverflowException.cs (1)
28public StackOverflowException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (2)
129catch (Exception assemblyNameException) 161catch (Exception assemblyLoadException)
src\libraries\System.Private.CoreLib\src\System\SystemException.cs (1)
26public SystemException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderExceptionFallback.cs (1)
91public DecoderFallbackException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Text\EncoderExceptionFallback.cs (1)
92public EncoderFallbackException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\AbandonedMutexException.cs (2)
29public AbandonedMutexException(string? message, Exception? inner) 49public AbandonedMutexException(string? message, Exception? inner, int location, WaitHandle? handle)
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (3)
751List<Exception>? exceptionList = null; 817catch (Exception ex) when (!throwOnFirstException) 820(exceptionList ??= new List<Exception>()).Add(ex);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (3)
181catch (Exception ex) 266catch (Exception ex) 433catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Threading\LockRecursionException.cs (1)
23public LockRecursionException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (1)
246catch (Exception e)
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
130catch (Exception) // Rollback state on exception
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreFullException.cs (1)
22public SemaphoreFullException(string? message, Exception? innerException) : base(message ?? SR.Threading_SemaphoreFullException, innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\SynchronizationLockException.cs (1)
29public SynchronizationLockException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (5)
215List<Exception>? exceptions = localThis.m_completionState.m_exceptions; 237cs.m_exceptions ??= new List<Exception>(faultedException.InnerExceptionCount); 300catch (Exception e) 327catch (Exception e) 479internal List<Exception>? m_exceptions;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (1)
1429public Exception? Exception => m_task.Exception;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (5)
499Exception? ex = null; 515catch (Exception e) { ex = e; } 675catch (Exception e) { promise.TrySetException(e); } // catch and log any scheduler exceptions 685catch (Exception e) { promise.TrySetException(e); } // catch and log any scheduler exceptions 1312catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (2)
73public void SetException(Exception error) 349catch (Exception ex)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (21)
1100catch (Exception e) 1693catch (Exception e) 1743var eoAsException = exceptionObject as Exception; 1744var eoAsEnumerableException = exceptionObject as IEnumerable<Exception>; 1829Exception? canceledException = null; 1889Exception? exception = GetExceptions(includeTaskCanceledExceptions); 1900internal static void ThrowAsync(Exception exception, SynchronizationContext? targetContext) 1915catch (Exception postException) 2351catch (Exception exn) 2414private void HandleException(Exception unhandledException) 2952catch (Exception e) 3185catch (Exception e) 3373(exceptionObject is Exception) || (exceptionObject is IEnumerable<Exception>) || 4972List<Exception>? exceptions = null; 5157internal static void AddExceptionsForCompletedTask(ref List<Exception>? exceptions, Task t) 5167exceptions ??= new List<Exception>(ex.InnerExceptionCount); 5445public static Task FromException(Exception exception) 5459public static Task<TResult> FromException<TResult>(Exception exception) 7154public Exception? Exception => m_task.Exception;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCanceledException.cs (2)
51public TaskCanceledException(string? message, Exception? innerException) : base(message ?? SR.TaskCanceledException_ctor_DefaultMessage, innerException) 63public TaskCanceledException(string? message, Exception? innerException, CancellationToken token) : base(message ?? SR.TaskCanceledException_ctor_DefaultMessage, innerException, token)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (8)
72/// The <see cref="SetResult"/>, <see cref="SetException(Exception)"/>, <see cref="SetException(IEnumerable{Exception})"/>, 87public void SetException(Exception exception) 105public void SetException(IEnumerable<Exception> exceptions) 125public bool TrySetException(Exception exception) 155public bool TrySetException(IEnumerable<Exception> exceptions) 162var defensiveCopy = new List<Exception>(); 163foreach (Exception e in exceptions)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource_T.cs (8)
72/// The <see cref="SetResult"/>, <see cref="SetException(Exception)"/>, <see cref="SetException(IEnumerable{Exception})"/>, 87public void SetException(Exception exception) 105public void SetException(IEnumerable<Exception> exceptions) 125public bool TrySetException(Exception exception) 155public bool TrySetException(IEnumerable<Exception> exceptions) 162var defensiveCopy = new List<Exception>(); 163foreach (Exception e in exceptions)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (5)
240catch (Exception e) 499catch (Exception exception) 705catch (Exception exception) // we explicitly do not request handling of dangerous exceptions like AVs 745catch (Exception exception) 797catch (Exception exception)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (8)
94exceptionObject is Exception || exceptionObject is IEnumerable<Exception> || 151if (exceptionObject is Exception exception) 165if (exceptionObject is IEnumerable<Exception> exColl) 170foreach (Exception exc in exColl) 252internal AggregateException CreateExceptionObject(bool calledFromFinalizer, Exception? includeThisException) 268Exception[] combinedExceptions = new Exception[exceptions.Count + 1];
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskSchedulerException.cs (2)
48public TaskSchedulerException(Exception? innerException) 60public TaskSchedulerException(string? message, Exception? innerException) : base(message ?? SR.TaskSchedulerException_ctor_DefaultMessage, innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (6)
137public static ValueTask FromException(Exception exception) => 143public static ValueTask<TResult> FromException<TResult>(Exception exception) => 207catch (Exception exc) 261catch (Exception exc) 614catch (Exception exc) 667catch (Exception exc)
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
89catch (Exception ex) when (ExceptionHandling.IsHandledByGlobalHandler(ex))
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadExceptionEventArgs.cs (3)
8private readonly Exception m_exception; 10public ThreadExceptionEventArgs(Exception t) 15public Exception Exception
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadInterruptedException.cs (1)
28public ThreadInterruptedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (1)
1233catch (Exception ex) when (ExceptionHandling.IsHandledByGlobalHandler(ex))
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadStartException.cs (1)
19internal ThreadStartException(Exception reason)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadStateException.cs (1)
29public ThreadStateException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandleCannotBeOpenedException.cs (1)
24public WaitHandleCannotBeOpenedException(string? message, Exception? innerException) : base(message ?? SR.Threading_WaitHandleCannotBeOpenedException, innerException)
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (5)
392internal static Exception CreateEndOfFileException() => 408internal static void ThrowInvalidOperationException(ExceptionResource resource, Exception e) 492internal static void ThrowAggregateException(List<Exception> exceptions) 651Exception? ex = Marshal.GetExceptionForHR(hr); 705private static Exception GetArraySegmentCtorValidationFailedException(Array? array, int offset, int count)
src\libraries\System.Private.CoreLib\src\System\TimeoutException.cs (1)
29public TimeoutException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (5)
607Exception? e; 649private static TimeZoneInfoResult TryFindSystemTimeZoneById(string id, out TimeZoneInfo? timeZone, out Exception? e) 1998private static TimeZoneInfoResult TryGetTimeZone(string id, bool dstDisabled, out TimeZoneInfo? value, out Exception? e, CachedData cachedData, bool alwaysFallbackToLocalMachine = false) 2053private static TimeZoneInfoResult TryGetTimeZoneUsingId(string id, bool dstDisabled, out TimeZoneInfo? value, out Exception? e, CachedData cachedData, bool alwaysFallbackToLocalMachine) 2121private static TimeZoneInfoResult TryGetTimeZoneFromLocalMachine(string id, bool dstDisabled, out TimeZoneInfo? value, out Exception? e, CachedData cachedData)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (2)
320private static TimeZoneInfoResult TryGetTimeZoneFromLocalMachine(string id, out TimeZoneInfo? value, out Exception? e) 354private static TimeZoneInfoResult TryGetTimeZone(string id, out TimeZoneInfo? timeZone, out Exception? e, CachedData cachedData)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (2)
73private static TimeZoneInfoResult TryGetTimeZoneFromLocalMachineCore(string id, out TimeZoneInfo? value, out Exception? e) 130catch (Exception ex) when (ex is IOException || ex is OutOfMemoryException)
src\libraries\System.Private.CoreLib\src\System\TimeZoneNotFoundException.cs (1)
23public TimeZoneNotFoundException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\TypeAccessException.cs (1)
28public TypeAccessException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\TypeInitializationException.cs (2)
28public TypeInitializationException(string? fullTypeName, Exception? innerException) 40internal TypeInitializationException(string? fullTypeName, string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\TypeLoadException.cs (1)
26public TypeLoadException(string? message, Exception? inner)
src\libraries\System.Private.CoreLib\src\System\TypeUnloadedException.cs (1)
26public TypeUnloadedException(string? message, Exception? innerException)
src\libraries\System.Private.CoreLib\src\System\UnauthorizedAccessException.cs (1)
29public UnauthorizedAccessException(string? message, Exception? inner)
src\System\Diagnostics\StackFrameHelper.cs (1)
86internal void InitializeSourceInfo(bool fNeedFileInfo, Exception? exception)
src\System\Diagnostics\StackTrace.CoreCLR.cs (3)
15internal static void GetStackFramesInternal(StackFrameHelper sfh, bool fNeedFileInfo, Exception? e) 46private void InitializeForException(Exception? exception, int skipFrames, bool fNeedFileInfo) 60private void CaptureStackTrace(int skipFrames, bool fNeedFileInfo, Exception? e)
src\System\Environment.CoreCLR.cs (3)
62public static void FailFast(string? message, Exception? exception) 72internal static void FailFast(string? message, Exception? exception, string? errorMessage) 81private static void FailFast(ref StackCrawlMark mark, string? message, Exception? exception, string? errorMessage)
src\System\Exception.CoreCLR.cs (3)
56private static extern bool IsImmutableAgileException(Exception e); 152private readonly Exception? _innerException; 231Exception _this = this;
src\System\GC.CoreCLR.cs (1)
327catch (Exception ex) when (ExceptionHandling.IsHandledByGlobalHandler(ex))
src\System\Reflection\RuntimeAssembly.cs (7)
742List<Exception> exceptions = new List<Exception>(); 752Exception? exception = null; 760catch (Exception e) 784exceptions.InsertRange(0, new Exception[numTypes]); // align the Exceptions with the null Types. 792private static void AddPublicNestedTypes(Type type, List<Type> types, List<Exception> exceptions) 799catch (Exception e)
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
687catch (Exception ex) when (ex is not OutOfMemoryException)
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (2)
368internal static Exception GetExceptionForHRInternal(int errorCode, IntPtr errorInfo) 370Exception? exception = null;
src\System\RuntimeHandles.cs (3)
1842catch (Exception) 1895catch (Exception) 1948catch (Exception)
src\System\RuntimeType.ActivatorCache.cs (1)
56catch (Exception ex)
src\System\RuntimeType.CoreCLR.cs (4)
1993internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception? e) 3986catch (Exception e) when (wrapExceptions) 4012catch (Exception e) 4038catch (Exception e)
src\System\StubHelpers.cs (7)
86catch (Exception) when (didAlloc) 1352internal static Exception GetHRExceptionObject(int hr) 1354Exception? ex = null; 1377private static Exception? s_pendingExceptionObject; 1379internal static Exception? GetPendingExceptionObject() 1381Exception? ex = s_pendingExceptionObject; 1391internal static void SetPendingExceptionObject(Exception? exception)
System.Private.DataContractSerialization (29)
src\libraries\Common\src\System\NotImplemented.cs (2)
14internal static Exception ByDesign => new NotImplementedException(); 19internal static Exception ByDesignWithMessage(string message)
System\Runtime\Serialization\DataContract.cs (4)
419catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 890catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 908catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 920catch (Exception ex) when (!ExceptionUtility.IsFatal(ex))
System\Runtime\Serialization\DataContractSet.cs (1)
421catch (Exception ex) when (!ExceptionUtility.IsFatal(ex))
System\Runtime\Serialization\ExceptionUtility.cs (2)
11public static bool IsFatal(Exception exception) 36foreach (Exception innerException in innerExceptions)
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (1)
176catch (Exception exception) when (exception is ArgumentException or FormatException or OverflowException)
System\Runtime\Serialization\Json\XmlJsonReader.cs (4)
351catch (Exception e) 691catch (Exception exception) when (exception is ArgumentException or FormatException or OverflowException) 709catch (Exception exception) when (exception is ArgumentException or FormatException or OverflowException) 948catch (Exception exception) when (exception is ArgumentException or FormatException or OverflowException)
System\Runtime\Serialization\SchemaImporter.cs (1)
64catch (Exception ex) when (!ExceptionUtility.IsFatal(ex))
System\Runtime\Serialization\XmlObjectSerializer.cs (3)
441internal static Exception CreateSerializationExceptionWithReaderDetails(string errorMessage, XmlReaderDelegator reader) 452internal static SerializationException CreateSerializationException(string errorMessage, Exception? innerException) 456internal static string GetTypeInfoError(string errorMessage, Type? type, Exception innerException)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
1080internal static Exception CreateUnexpectedStateException(XmlNodeType expectedState, XmlReaderDelegator xmlReader)
System\Runtime\Serialization\XsdDataContractExporter.cs (6)
123catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 152catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 175catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 331catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 366catch (Exception ex) when (!ExceptionUtility.IsFatal(ex)) 396catch (Exception ex) when (!ExceptionUtility.IsFatal(ex))
System\Xml\XmlExceptionHelper.cs (4)
304public static XmlException CreateConversionException(string type, Exception exception) 309public static XmlException CreateConversionException(string value, string type, Exception exception) 314public static XmlException CreateEncodingException(byte[] buffer, int offset, int count, Exception exception) 319public static XmlException CreateEncodingException(string value, Exception exception)
System.Private.Uri (1)
System\UriFormatException.cs (1)
24public UriFormatException(string? textString, Exception? e) : base(textString, e)
System.Private.Windows.Core (25)
System\ExceptionExtensions.cs (2)
16internal static bool IsCriticalException(this Exception ex) 28internal static SerializationException ConvertToSerializationException(this Exception ex)
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
800catch (Exception ex) when (!ex.IsCriticalException())
System\Private\Windows\JsonData.cs (1)
122catch (Exception ex)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (3)
31catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException or TargetInvocationException) 71catch (Exception ex) when (ex is KeyNotFoundException or InvalidCastException) 610catch (Exception ex)
System\Private\Windows\Ole\BinaryFormatUtilities.cs (5)
28catch (Exception ex) when (!ex.IsCriticalException()) 72catch (Exception ex) when (!ex.IsCriticalException()) 143catch (Exception ex) when (!ex.IsCriticalException() && request.UntypedRequest) 162catch (Exception ex) when (!ex.IsCriticalException()) 197catch (Exception ex) when (!ex.IsCriticalException())
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
141catch (Exception) when (!pmedium->hGlobal.IsNull)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (2)
273catch (Exception e) when (request.UntypedRequest || e is not NotSupportedException) 330catch (Exception ex) when (request.UntypedRequest || ex is not NotSupportedException)
System\Private\Windows\Ole\Composition.RuntimeToNativeAdapter.cs (4)
45catch (Exception e) 100catch (Exception e) 118catch (Exception e) 141catch (Exception e)
Windows\Win32\Foundation\HRESULT.cs (1)
52public static implicit operator HRESULT(Exception ex)
Windows\Win32\System\Com\ComHelpers.cs (2)
107catch (Exception ex) 221catch (Exception ex)
Windows\Win32\System\Com\WinFormsComWrappers.cs (3)
68catch (Exception ex) 84catch (Exception ex) 111catch (Exception ex)
System.Private.Windows.GdiPlus (1)
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (1)
20internal static Exception GetException(this Status status)
System.Private.Xml (294)
System\Xml\Core\IDtdParserAdapter.cs (1)
47void Throw(Exception e);
System\Xml\Core\IValidationEventHandling.cs (1)
15void SendEvent(Exception exception, XmlSeverityType severity);
System\Xml\Core\XmlReader.cs (4)
1426internal Exception CreateReadContentAsException(string methodName) 1431internal Exception CreateReadElementContentAsException(string methodName) 1441internal static Exception CreateReadContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo? lineInfo) 1446internal static Exception CreateReadElementContentAsException(string methodName, XmlNodeType nodeType, IXmlLineInfo? lineInfo)
System\Xml\Core\XmlTextReaderImpl.cs (9)
2628internal void DtdParserProxy_Throw(Exception e) 2704private void Throw(string res, string? arg, Exception innerException) 2710private void Throw(string res, string?[] args, Exception innerException) 2716private void Throw(Exception e) 2730private void ReThrow(Exception e, int lineNo, int linePos) 2732Throw(new XmlException(e.Message, (Exception?)null, lineNo, linePos, _ps.baseUriStr)); 2748private void ThrowWithoutLineInfo(string res, string?[] args, Exception? innerException) 7905catch (Exception) 7922catch (Exception e)
System\Xml\Core\XmlTextReaderImplAsync.cs (2)
5115catch (Exception) 5131catch (Exception e)
System\Xml\Core\XmlTextReaderImplHelpers.cs (1)
289void IDtdParserAdapter.Throw(Exception e)
System\Xml\Core\XmlValidatingReaderImpl.cs (1)
54void IValidationEventHandling.SendEvent(Exception /*XmlSchemaException*/ exception, XmlSeverityType severity)
System\Xml\Dom\XmlLoader.cs (1)
1000internal static Exception UnexpectedNodeType(XmlNodeType nodetype)
System\Xml\Schema\BaseProcessor.cs (1)
228protected void SendValidationEvent(string code, string?[]? args, Exception innerException, XmlSchemaObject source)
System\Xml\Schema\DataTypeImplementation.cs (74)
532Exception? exception = TryParseValue(s, nameTable, nsmgr, out typedValue); 553Exception? exception = TryParseValue(s, nameTable, nsmgr, out typedValue); 568internal override Exception? TryParseValue(object value, XmlNameTable? nameTable, IXmlNamespaceResolver? namespaceResolver, out object? typedValue) 572Exception? exception; 1014internal override Exception? TryParseValue(object value, XmlNameTable? nameTable, IXmlNamespaceResolver? namespaceResolver, out object? typedValue) 1018Exception? exception; 1090internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1092Exception? exception; 1238internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1240Exception? exception; 1277internal override Exception? TryParseValue(object value, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1281Exception? exception; 1375internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1456internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1458Exception? exception; 1527internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1529Exception? exception; 1609internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1611Exception? exception; 1695internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1697Exception? exception; 1787internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1789Exception? exception; 1875internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1877Exception? exception; 1906internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1908Exception? exception; 1944internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 1946Exception? exception; 2030internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2032Exception? exception; 2412internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2414Exception? exception; 2510internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2512Exception? exception; 2614internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2616Exception? exception; 2699internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2701Exception? exception; 2899internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 2901Exception? exception; 3032internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3034Exception? exception; 3112internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3114Exception? exception; 3228internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3230Exception? exception; 3282internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3284Exception? exception; 3337internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3339Exception? exception; 3391internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3393Exception? exception; 3477internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3479Exception? exception; 3531internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3533Exception? exception; 3585internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3587Exception? exception; 3638internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3640Exception? exception; 3695catch (Exception e) 3717catch (Exception e) 3751catch (Exception e) 3791catch (Exception e) 3797internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3799Exception? exception; 3820Exception? exception; 3834catch (Exception e) 3842internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3844Exception? exception; 3887catch (Exception e) 3893internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) 3895Exception? exception;
System\Xml\Schema\FacetChecker.cs (41)
369catch (Exception e) 666Exception? ex = datatype.TryParseValue(facet.Value!, nameTable, nsmgr, out typedValue); 777internal virtual Exception? CheckLexicalFacets(ref string parseString, XmlSchemaDatatype datatype) 782internal virtual Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 786internal virtual Exception? CheckValueFacets(decimal value, XmlSchemaDatatype datatype) 790internal virtual Exception? CheckValueFacets(long value, XmlSchemaDatatype datatype) 794internal virtual Exception? CheckValueFacets(int value, XmlSchemaDatatype datatype) 798internal virtual Exception? CheckValueFacets(short value, XmlSchemaDatatype datatype) 802internal virtual Exception? CheckValueFacets(DateTime value, XmlSchemaDatatype datatype) 806internal virtual Exception? CheckValueFacets(double value, XmlSchemaDatatype datatype) 810internal virtual Exception? CheckValueFacets(float value, XmlSchemaDatatype datatype) 814internal virtual Exception? CheckValueFacets(string value, XmlSchemaDatatype datatype) 818internal virtual Exception? CheckValueFacets(byte[] value, XmlSchemaDatatype datatype) 822internal virtual Exception? CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 826internal virtual Exception? CheckValueFacets(XmlQualifiedName value, XmlSchemaDatatype datatype) 868internal static Exception? CheckPatternFacets(RestrictionFacets? restriction, string value) 997internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1003internal override Exception? CheckValueFacets(decimal value, XmlSchemaDatatype datatype) 1061internal override Exception? CheckValueFacets(long value, XmlSchemaDatatype datatype) 1067internal override Exception? CheckValueFacets(int value, XmlSchemaDatatype datatype) 1072internal override Exception? CheckValueFacets(short value, XmlSchemaDatatype datatype) 1093internal static Exception? CheckTotalAndFractionDigits(decimal value, int totalDigits, int fractionDigits, bool checkTotal, bool checkFraction) 1122internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1128internal override Exception? CheckValueFacets(double value, XmlSchemaDatatype datatype) 1174internal override Exception? CheckValueFacets(float value, XmlSchemaDatatype datatype) 1198internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1204internal override Exception? CheckValueFacets(TimeSpan value, XmlSchemaDatatype datatype) 1269internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1275internal override Exception? CheckValueFacets(DateTime value, XmlSchemaDatatype datatype) 1347internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1353internal override Exception? CheckValueFacets(string value, XmlSchemaDatatype datatype) 1358internal static Exception? CheckValueFacets(string value, XmlSchemaDatatype datatype, bool verifyUri) 1364Exception? exception; 1433private static Exception? CheckBuiltInFacets(string s, XmlTypeCode typeCode, bool verifyUri) 1435Exception? exception = null; 1488internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1494internal override Exception? CheckValueFacets(XmlQualifiedName value, XmlSchemaDatatype datatype) 1560internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1566internal override Exception? CheckValueFacets(byte[] value, XmlSchemaDatatype datatype) 1625internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) 1701internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype)
System\Xml\Schema\Inference\XmlSchemaInferenceException.cs (3)
36public XmlSchemaInferenceException(string message) : base(message, ((Exception?)null), 0, 0) 40public XmlSchemaInferenceException(string message, Exception? innerException) : base(message, innerException, 0, 0) 44public XmlSchemaInferenceException(string message, Exception? innerException, int lineNumber, int linePosition) :
System\Xml\Schema\Preprocessor.cs (5)
287Exception? innerException = null; 294catch (Exception e) 341catch (Exception eInner) 397catch (Exception eInner) 543Exception? exception = tokenDt.TryParseValue(schema.Version, null, null, out version);
System\Xml\Schema\SchemaCollectionpreProcessor.cs (4)
242catch (Exception) 321catch (Exception) 1726catch (Exception ex) 1767catch (Exception ex)
System\Xml\Schema\XdrValidator.cs (1)
358catch (Exception e)
System\Xml\Schema\XmlSchemaDataType.cs (2)
64internal abstract Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue); 66internal abstract Exception? TryParseValue(object value, XmlNameTable? nameTable, IXmlNamespaceResolver? namespaceResolver, out object? typedValue);
System\Xml\Schema\XmlSchemaException.cs (4)
80public XmlSchemaException(string? message) : this(message, ((Exception?)null), 0, 0) 87public XmlSchemaException(string? message, Exception? innerException) : this(message, innerException, 0, 0) 91public XmlSchemaException(string? message, Exception? innerException, int lineNumber, int linePosition) : 128internal XmlSchemaException(string? res, string?[]? args, Exception? innerException, string? sourceUri, int lineNumber, int linePosition, XmlSchemaObject? source) :
System\Xml\Schema\XmlSchemaValidationException.cs (4)
37public XmlSchemaValidationException(string? message) : base(message, ((Exception?)null), 0, 0) 41public XmlSchemaValidationException(string? message, Exception? innerException) : base(message, innerException, 0, 0) 45public XmlSchemaValidationException(string? message, Exception? innerException, int lineNumber, int linePosition) : 60internal XmlSchemaValidationException(string? res, string?[]? args, Exception? innerException, string? sourceUri, int lineNumber, int linePosition) :
System\Xml\Schema\XmlSchemaValidator.cs (9)
1275Exception? exception = s_dtStringArray.TryParseValue(xsiSchemaLocation, _nameTable, _nsResolver, out typedValue); 1430Exception? exception = currentElementDecl.Datatype.TryParseValue(currentElementDecl.DefaultValueRaw, _nameTable, _nsResolver, out typedVal); 1474Exception? exception = dtype.TryParseValue(parsedValue, _nameTable, _nsResolver, out typedValue); 1647Exception? exception = s_dtQName.TryParseValue(xsiType, _nameTable, _nsResolver, out typedVal); 1859catch (Exception e) 1936Exception? exception; 1975Exception? exception = dtype.TryParseValue(stringValue, _nameTable, _nsResolver, out typedValue); 2822private void SendValidationEvent(string? code, string?[]? args, Exception? innerException, XmlSeverityType severity) 2830private void SendValidationEvent(string? code, string?[]? args, Exception? innerException)
System\Xml\Schema\XmlValueConverter.cs (1)
475protected Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType)
System\Xml\Schema\XsdBuilder.cs (4)
2460catch (Exception) 2472catch (Exception) 2484catch (Exception) 2511catch (Exception)
System\Xml\Schema\XsdDuration.cs (7)
148Exception? exception = TryParse(s, durationType, out result); 249Exception? exception = TryToTimeSpan(durationType, out result); 258internal Exception? TryToTimeSpan(out TimeSpan result) 263internal Exception? TryToTimeSpan(DurationType durationType, out TimeSpan result) 265Exception? exception; 447internal static Exception? TryParse(string s, out XsdDuration result) 452internal static Exception? TryParse(string s, DurationType durationType, out XsdDuration result)
System\Xml\Schema\XsdValidator.cs (1)
606catch (Exception e)
System\Xml\Serialization\Compilation.cs (2)
161catch (Exception e) 254catch (Exception e)
System\Xml\Serialization\Globals.cs (1)
14internal static Exception NotSupported(string msg)
System\Xml\Serialization\SoapReflectionImporter.cs (2)
137private static InvalidOperationException ReflectionException(string context, Exception e) 624catch (Exception e)
System\Xml\Serialization\Types.cs (3)
97private Exception? _exception; 350internal Exception? Exception 761Exception? exception = null;
System\Xml\Serialization\XmlReflectionImporter.cs (6)
374private static InvalidOperationException CreateReflectionException(string context, Exception e) 379private static InvalidOperationException CreateTypeReflectionException(string context, Exception e) 384private static InvalidOperationException CreateMemberReflectionException(FieldModel model, Exception e) 476catch (Exception e) 893catch (Exception e) 1306catch (Exception e)
System\Xml\Serialization\XmlSchemas.cs (1)
691internal static Exception CreateValidationException(XmlSchemaException exception, string message)
System\Xml\Serialization\XmlSerializationReader.cs (12)
1068catch (Exception e) 1283protected Exception CreateUnknownTypeException(XmlQualifiedName type) 1288protected Exception CreateReadOnlyCollectionException(string name) 1293protected Exception CreateAbstractTypeException(string name, string? ns) 1298protected Exception CreateInaccessibleConstructorException(string typeName) 1303protected Exception CreateCtorHasSecurityException(string typeName) 1308protected Exception CreateUnknownNodeException() 1313protected Exception CreateUnknownConstantException(string? value, Type enumType) 1318protected Exception CreateInvalidCastException(Type type, object? value) 1323protected Exception CreateInvalidCastException(Type type, object? value, string? id) 1333protected Exception CreateBadDerivationException(string? xsdDerived, string? nsDerived, string? xsdBase, string? nsBase, string? clrDerived, string? clrBase) 1338protected Exception CreateMissingIXmlSerializableType(string? name, string? ns, string? clrType)
System\Xml\Serialization\XmlSerializationWriter.cs (9)
812protected Exception CreateUnknownTypeException(object o) 818protected Exception CreateUnknownTypeException(Type type) 826protected Exception CreateMismatchChoiceException(string value, string elementName, string enumValue) 832protected Exception CreateUnknownAnyElementException(string name, string ns) 837protected Exception CreateInvalidChoiceIdentifierValueException(string type, string identifier) 842protected Exception CreateChoiceIdentifierValueException(string value, string identifier, string name, string ns) 848protected Exception CreateInvalidEnumValueException(object value, string typeName) 853protected Exception CreateInvalidAnyTypeException(object o) 858protected Exception CreateInvalidAnyTypeException(Type type)
System\Xml\Serialization\XmlSerializer.cs (2)
413catch (Exception? e) 513catch (Exception? e)
System\Xml\ValidateNames.cs (1)
390internal static Exception GetInvalidNameException(string s, int offsetStartChar, int offsetBadChar)
System\Xml\XmlConvert.cs (42)
329internal static Exception? TryVerifyName(string name) 385internal static Exception? TryVerifyNCName(string name) 419internal static Exception? TryVerifyTOKEN(string token) 465internal static Exception? TryVerifyNMTOKEN(string name) 481internal static Exception? TryVerifyNormalizedString(string str) 760internal static Exception? TryToBoolean(string s, out bool result) 790internal static Exception? TryToChar(string s, out char result) 805internal static Exception? TryToDecimal(string s, out decimal result) 820internal static Exception? TryToInteger(string s, out decimal result) 836internal static Exception? TryToSByte(string s, out sbyte result) 851internal static Exception? TryToInt16(string s, out short result) 866internal static Exception? TryToInt32(string s, out int result) 881internal static Exception? TryToInt64(string s, out long result) 896internal static Exception? TryToByte(string s, out byte result) 912internal static Exception? TryToUInt16(string s, out ushort result) 928internal static Exception? TryToUInt32(string s, out uint result) 944internal static Exception? TryToUInt64(string s, out ulong result) 976internal static Exception? TryToSingle(string s, out float result) 1023internal static Exception? TryToDouble(string s, out double result) 1118catch (Exception) 1129internal static Exception? TryToTimeSpan(string s, out TimeSpan result) 1132Exception? exception; 1266internal static Exception? TryToGuid(string s, out Guid result) 1268Exception? exception = null; 1327internal static Exception? TryToUri(string s, out Uri? result) 1529internal static Exception CreateException(string res, ExceptionType exceptionType, int lineNo, int linePos) 1541internal static Exception CreateException(string res, string arg, ExceptionType exceptionType) 1546internal static Exception CreateException(string res, string arg, ExceptionType exceptionType, int lineNo, int linePos) 1558internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType) 1563internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType, int lineNo, int linePos) 1575internal static Exception CreateInvalidSurrogatePairException(char low, char hi) 1580internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType) 1585internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType, int lineNo, int linePos) 1594internal static Exception CreateInvalidHighSurrogateCharException(char hi) 1599internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType) 1604internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType, int lineNo, int linePos) 1609internal static Exception CreateInvalidCharException(char[] data, int length, int invCharPos, ExceptionType exceptionType) 1614internal static Exception CreateInvalidCharException(string data, int invCharPos) 1619internal static Exception CreateInvalidCharException(string data, int invCharPos, ExceptionType exceptionType) 1624internal static Exception CreateInvalidCharException(char invChar, char nextChar) 1629internal static Exception CreateInvalidCharException(char invChar, char nextChar, ExceptionType exceptionType) 1634internal static Exception CreateInvalidNameCharException(string name, int index, ExceptionType exceptionType)
System\Xml\XmlException.cs (8)
90public XmlException(string? message) : this(message, ((Exception?)null), 0, 0) 96public XmlException(string? message, Exception? innerException) : this(message, innerException, 0, 0) 101public XmlException(string? message, Exception? innerException, int lineNumber, int linePosition) : 106internal XmlException(string? message, Exception? innerException, int lineNumber, int linePosition, string? sourceUri) : 133internal XmlException(string res, string? arg, Exception? innerException, IXmlLineInfo? lineInfo) : 162internal XmlException(string res, string?[]? args, Exception? innerException, int lineNumber, int linePosition) : 166internal XmlException(string res, string?[]? args, Exception? innerException, int lineNumber, int linePosition, string? sourceUri) : 292internal static bool IsCatchableException(Exception e)
System\Xml\XPath\Internal\FunctionQuery.cs (1)
90catch (Exception ex)
System\Xml\XPath\XPathException.cs (5)
65public XPathException() : this(string.Empty, (Exception?)null) { } 67public XPathException(string? message) : this(message, (Exception?)null) { } 69public XPathException(string? message, Exception? innerException) : 89internal static XPathException Create(string res, string arg, Exception innerException) 99private XPathException(string res, string?[]? args, Exception? inner) :
System\Xml\Xsl\IlGen\XmlILTrace.cs (1)
138catch (Exception e)
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (1)
292catch (Exception e)
System\Xml\Xsl\Runtime\XmlQueryContext.cs (1)
150catch (Exception e)
System\Xml\Xsl\XslException.cs (2)
16public XslTransformException(Exception? inner, string res, params string?[]? args) 110internal XslLoadException(Exception? inner, ISourceLineInfo? lineInfo)
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
173catch (Exception e)
System\Xml\Xsl\Xslt\XsltLoader.cs (1)
267catch (Exception e)
System\Xml\Xsl\XsltOld\Compiler.cs (1)
196catch (Exception e)
System\Xml\Xsl\XsltOld\ContainerAction.cs (2)
211catch (Exception e) 258catch (Exception e)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (1)
842catch (Exception e)
System\Xml\Xslt\XsltException.cs (7)
72public XsltException() : this(string.Empty, (Exception?)null) { } 74public XsltException(string message) : this(message, (Exception?)null) { } 76public XsltException(string message, Exception? innerException) : 86internal static XsltException Create(string res, string?[] args, Exception inner) 91internal XsltException(string res, string?[] args, string? sourceUri, int lineNumber, int linePosition, Exception? inner) 174public XsltCompileException(string message, Exception innerException) : base(message, innerException) { } 176public XsltCompileException(Exception inner, string sourceUri, int lineNumber, int linePosition) :
System.Reflection.Metadata (15)
System\Reflection\Internal\Utilities\ExceptionUtilities.cs (1)
8internal static Exception UnexpectedValue(object value)
System\Reflection\Metadata\ImageFormatLimitationException.cs (1)
20public ImageFormatLimitationException(string? message, Exception? innerException)
System\Reflection\PortableExecutable\PEReader.cs (7)
729catch (Exception e) 734Exception? errorToReport = null; 768private bool TryOpenCodeViewPortablePdb(DebugDirectoryEntry codeViewEntry, string peImageDirectory, Func<string, Stream?> pdbFileStreamProvider, out MetadataReaderProvider? provider, out string? pdbPath, ref Exception? errorToReport) 779catch (Exception e) when (e is BadImageFormatException || e is IOException) 803private static bool TryOpenPortablePdbFile(string path, BlobContentId id, Func<string, Stream?> pdbFileStreamProvider, out MetadataReaderProvider? provider, ref Exception? errorToReport) 843catch (Exception e) when (e is BadImageFormatException || e is IOException) 857partial void TryOpenEmbeddedPortablePdb(DebugDirectoryEntry embeddedPdbEntry, ref bool openedEmbeddedPdb, ref MetadataReaderProvider? provider, ref Exception? errorToReport);
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (4)
85catch (Exception e) 110catch (Exception e) 142partial void TryOpenEmbeddedPortablePdb(DebugDirectoryEntry embeddedPdbEntry, ref bool openedEmbeddedPdb, ref MetadataReaderProvider? provider, ref Exception? errorToReport) 158catch (Exception e) when (e is BadImageFormatException || e is IOException)
System\Reflection\Throw.cs (2)
33internal static Exception InvalidArgument_UnexpectedHandleKind(HandleKind kind) 39internal static Exception InvalidArgument_Handle(string parameterName)
System.Reflection.MetadataLoadContext (33)
System\CoreRtBridge.cs (1)
34internal static Exception CreateMissingMetadataException() => new Exception();
System\Reflection\MetadataLoadContext.CoreAssembly.cs (2)
15internal RoAssembly? TryGetCoreAssembly(string? coreAssemblyName, out Exception? e) 31private RoAssembly? TryGetDefaultCoreAssembly(out Exception? e)
System\Reflection\MetadataLoadContext.Resolving.cs (2)
29RoAssembly? assembly = TryResolveAssembly(refName, out Exception? e); 33internal RoAssembly? TryResolveAssembly(RoAssemblyName refName, out Exception? e)
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (2)
123internal RoDefinitionType? GetTypeCore(string ns, string name, bool ignoreCase, out Exception? e) => GetTypeCore(ns.ToUtf8(), name.ToUtf8(), ignoreCase, out e); 124internal RoDefinitionType? GetTypeCore(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, bool ignoreCase, out Exception? e)
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (5)
17List<Exception>? exceptions = null; 23Exception? exception = null; 31type = redirectedAssembly.GetTypeCore(ns, name, ignoreCase: false, out Exception? e); 47exceptions ??= new List<Exception>(); 58exceptions.InsertRange(0, new Exception[numTypes]); // align the Exceptions with the null Types.
System\Reflection\TypeLoading\Assemblies\RoExceptionAssembly.cs (2)
12internal RoExceptionAssembly(Exception exception) 18internal Exception Exception { get; }
System\Reflection\TypeLoading\General\CoreTypes.cs (5)
12private readonly Exception?[] _exceptions; 18Exception?[] exceptions = new Exception[numCoreTypes]; 19RoAssembly? coreAssembly = loader.TryGetCoreAssembly(coreAssemblyName, out Exception? e); 46public Exception? GetException(CoreType coreType) => _exceptions[(int)coreType];
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (6)
66RoDefinitionType? type = module.GetEcmaAssembly().GetTypeCore(ns, name, ignoreCase: false, out Exception? e); 79RoDefinitionType? type = assembly.GetTypeCore(ns, name, ignoreCase: false, out Exception? e); 94RoDefinitionType? type = module.GetTypeCore(ns, name, ignoreCase: false, out Exception? e); 107RoDefinitionType? type = targetModule.GetTypeCore(ns, name, ignoreCase: false, out Exception? e); 150RoAssembly? assembly = handle.TryResolveAssembly(module, out Exception? e); 156public static RoAssembly? TryResolveAssembly(this AssemblyReferenceHandle handle, EcmaModule module, out Exception? e)
System\Reflection\TypeLoading\General\Helpers.cs (2)
299RoType? type = defaultAssembly.GetTypeCore(ns, simpleName, ignoreCase: ignoreCase, out Exception? e); 321Type? type = roAssembly.GetTypeCore(ns, simpleName, ignoreCase: ignoreCase2, out Exception? e);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.GetTypeCore.cs (1)
22protected sealed override RoDefinitionType? GetTypeCoreNoCache(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, out Exception? e)
System\Reflection\TypeLoading\Modules\RoModule.cs (2)
118internal RoDefinitionType? GetTypeCore(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, bool ignoreCase, out Exception? e) 139protected abstract RoDefinitionType? GetTypeCoreNoCache(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, out Exception? e);
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (1)
54protected sealed override RoDefinitionType? GetTypeCoreNoCache(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, out Exception? e)
System\Reflection\TypeLoading\Types\RoExceptionType.cs (2)
15internal Exception? Exception { get; } 17internal RoExceptionType(ReadOnlySpan<byte> ns, ReadOnlySpan<byte> name, Exception? exception)
System.Resources.Extensions (3)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.cs (2)
51catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException) 72catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException)
System\Resources\Extensions\BinaryFormat\SerializationExtensions.cs (1)
15public static SerializationException ConvertToSerializationException(this Exception ex)
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
184[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Exception))]
System.Runtime.Caching (1)
System\Runtime\Caching\Dbg.cs (1)
18internal static void Trace(string tagName, string message, Exception e = null)
System.Runtime.InteropServices (10)
System\Runtime\InteropServices\Marshalling\ExceptionAsDefaultMarshaller.cs (2)
10[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsDefaultMarshaller<>))] 19public static T ConvertToUnmanaged(Exception e)
System\Runtime\InteropServices\Marshalling\ExceptionAsHResultMarshaller.cs (4)
12/// Marshals an exception object to the value of its <see cref="Exception.HResult"/> converted to <typeparamref name="T"/>. 20[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsHResultMarshaller<>))] 25/// Marshals an exception object to the value of its <see cref="Exception.HResult"/> converted to <typeparamref name="T"/>. 29public static T ConvertToUnmanaged(Exception e)
System\Runtime\InteropServices\Marshalling\ExceptionAsNaNMarshaller.cs (2)
12[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsNaNMarshaller<>))] 21public static T ConvertToUnmanaged(Exception e)
System\Runtime\InteropServices\Marshalling\ExceptionAsVoidMarshaller.cs (2)
13[CustomMarshaller(typeof(Exception), MarshalMode.UnmanagedToManagedOut, typeof(ExceptionAsVoidMarshaller))] 21public static void ConvertToUnmanaged(Exception e)
System.Runtime.InteropServices.JavaScript (2)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net10.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (2)
268public void ToManaged(out Exception? value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 269public void ToJS(Exception? value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Runtime.Numerics (1)
System\Number.BigInteger.cs (1)
33private static Exception GetException(ParsingStatus status)
System.Runtime.Serialization.Formatters (2)
System\Runtime\Serialization\FormatterServices.cs (1)
309catch (Exception) { }
System\Runtime\Serialization\ObjectManager.cs (1)
788catch (Exception e)
System.Runtime.Serialization.Primitives (1)
System\Runtime\Serialization\InvalidDataContractException.cs (1)
24public InvalidDataContractException(string? message, Exception? innerException)
System.Runtime.Serialization.Schema (12)
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (10)
13public static bool IsFatal(Exception exception) 38foreach (Exception innerException in innerExceptions) 75public static Exception ThrowHelperArgumentNull(string message) 80public static Exception ThrowHelperError(Exception e) 85public static Exception ThrowHelperArgument(string message) 90internal static Exception ThrowHelperFatal(string message, Exception innerException) 94internal static Exception ThrowHelperCallback(Exception e)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (2)
316catch (Exception ex) 351catch (Exception ex)
System.Security.AccessControl (2)
artifacts\obj\System.Security.AccessControl\Debug\net10.0\System.Security.AccessControl.notsupported.cs (2)
334protected internal delegate System.Exception? ExceptionFromErrorCode(int errorCode, string? name, System.Runtime.InteropServices.SafeHandle? handle, object? context); 445public PrivilegeNotHeldException(string? privilege, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); }
System.Security.Cryptography (26)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Bignum.cs (1)
30Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs (1)
87Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (2)
47internal static Exception CreateOpenSslCryptographicException() 94Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs (1)
152Exception e = CreateOpenSslCryptographicException();
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeDsaHandle.Unix.cs (1)
40Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeEcKeyHandle.Unix.cs (1)
40Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\System\IO\MemoryMappedFiles\MemoryMappedFileMemoryManager.cs (1)
54catch (Exception)
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (2)
129Exception e = Interop.Crypto.CreateOpenSslCryptographicException(); 188Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSslPublicKey.cs (1)
25Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (1)
41Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (1)
368catch (Exception e) when (!(e is CryptographicException))
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (1)
692private static void ThrowWithHResult(string message, int hResult, Exception innerException)
System\Security\Cryptography\AesImplementation.OpenSsl.cs (1)
60_ => throw (keySize == 128 || keySize == 192 || keySize == 256 ? (Exception)
System\Security\Cryptography\AuthenticationTagMismatchException.cs (1)
42public AuthenticationTagMismatchException(string? message, Exception? inner)
System\Security\Cryptography\CryptographicUnexpectedOperationException.cs (1)
24public CryptographicUnexpectedOperationException(string? message, Exception? inner)
System\Security\Cryptography\DSASignatureFormat.cs (1)
44internal static Exception CreateUnknownValueException(DSASignatureFormat signatureFormat) =>
System\Security\Cryptography\SafeEvpPKeyHandle.OpenSsl.cs (1)
79Exception e = Interop.Crypto.CreateOpenSslCryptographicException();
System\Security\Cryptography\X509Certificates\IChainPal.cs (1)
13bool? Verify(X509VerificationFlags flags, out Exception? exception);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
124catch (Exception e)
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
80public bool? Verify(X509VerificationFlags flags, out Exception? exception)
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (2)
162catch (Exception) 190catch (Exception)
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
145Exception? verificationException;
System\Security\Cryptography\XmlKeyHelper.cs (1)
23catch (Exception e)
System.Security.Cryptography.Cose (7)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
326catch (Exception ex) when (ex is CborContentException or InvalidOperationException)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (4)
144catch (Exception ex) when (ex is CborContentException or InvalidOperationException or OverflowException) 171catch (Exception ex) when (ex is CborContentException or InvalidOperationException) 198catch (Exception ex) when (ex is CborContentException or InvalidOperationException) 230catch (Exception ex) when (ex is CborContentException or InvalidOperationException)
System\Security\Cryptography\Cose\CoseMessage.cs (2)
166catch (Exception ex) when (ex is CborContentException or InvalidOperationException) 252catch (Exception ex) when (ex is CborContentException or InvalidOperationException)
System.Security.Cryptography.Pkcs (19)
Internal\Cryptography\DecryptorPal.cs (1)
39out Exception? exception);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (3)
38out Exception? exception) 97out Exception? exception) 146out Exception? exception)
Internal\Cryptography\Pal\AnyOS\ManagedPal.Exceptions.cs (4)
11public override Exception CreateRecipientsNotFoundException() 16public override Exception CreateRecipientInfosAfterEncryptException() 21public override Exception CreateDecryptAfterEncryptException() 26public override Exception CreateDecryptTwiceException()
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (3)
35internal byte[]? DecryptCek(X509Certificate2? cert, RSA? privateKey, out Exception? exception) 69out Exception? exception) 184out Exception? exception)
Internal\Cryptography\PkcsHelpers.cs (1)
390[NotNullWhen(false)] out Exception? exception)
Internal\Cryptography\PkcsPal.cs (4)
51public abstract Exception CreateRecipientsNotFoundException(); 57public abstract Exception CreateRecipientInfosAfterEncryptException(); 63public abstract Exception CreateDecryptAfterEncryptException(); 69public abstract Exception CreateDecryptTwiceException();
System\Security\Cryptography\Pkcs\EnvelopedCms.cs (2)
238out Exception? exception); 258Exception? exception = PkcsPal.Instance.CreateRecipientsNotFoundException();
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
277catch (Exception) when (contentType != Oids.Pkcs7Data)
System.Security.Cryptography.Xml (4)
System\Security\Cryptography\Xml\CryptoHelpers.cs (1)
87catch (Exception)
System\Security\Cryptography\Xml\CryptoSignedXmlRecursionException.cs (1)
22public CryptoSignedXmlRecursionException(string message, Exception inner) : base(message, inner) { }
System\Security\Cryptography\Xml\DSAKeyValue.cs (1)
209catch (Exception ex)
System\Security\Cryptography\Xml\RSAKeyValue.cs (1)
140catch (Exception ex)
System.Security.Permissions (3)
System\Security\HostProtectionException.cs (1)
36public HostProtectionException(string message, Exception e) : base(message, e)
System\Security\Policy\PolicyException.cs (1)
20public PolicyException(string message, Exception exception) : base(message, exception) { }
System\Security\XmlSyntaxException.cs (1)
16public XmlSyntaxException(string message, Exception inner) { }
System.Security.Principal.Windows (1)
artifacts\obj\System.Security.Principal.Windows\Debug\net10.0\System.Security.Principal.Windows.notsupported.cs (1)
24public IdentityNotMappedException(string? message, System.Exception? inner) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Principal); }
System.ServiceModel.Federation (16)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (3)
147private Exception CreateNotOpenException() 152private Exception CreateClosedException() 157internal Exception CreateFaultedException()
System\Runtime\Fx.cs (3)
11public static bool IsFatal(Exception exception) 33ReadOnlyCollection<Exception> innerExceptions = aggException.InnerExceptions; 34foreach (Exception innerException in innerExceptions)
System\Runtime\OperationWithTimeoutAsyncResult.cs (9)
31Exception completionException = null; 36catch (Exception e) 60private Exception _exception; 111protected Action<AsyncResult, Exception> OnCompleting { get; set; } 145catch (Exception exception) 187catch (Exception e) 199protected void Complete(bool completedSynchronously, Exception exception) 229Exception completionException = null; 234catch (Exception e)
System\ServiceModel\Security\SecurityUtils.cs (1)
18Exception faultException = new FaultException(fault, message.Headers.Action);
System.ServiceModel.Federation.Tests (2)
WSTrustChannelFactoryTest.cs (1)
19catch(Exception ex)
WSTrustChannelTest.cs (1)
19catch(Exception ex)
System.ServiceModel.NetFramingBase (37)
System\ServiceModel\Channels\BufferedConnection.cs (3)
15private Exception _pendingWriteException; 79catch (Exception e) 227Exception exceptionTothrow = _pendingWriteException;
System\ServiceModel\Channels\Connection.cs (1)
344private Exception ConvertIOException(IOException ioException)
System\ServiceModel\Channels\ConnectionPool.cs (3)
344var toe = ae.InnerExceptions.FirstOrDefault(e => e is TimeoutException); 524catch (Exception e) 641catch (Exception) { }
System\ServiceModel\Channels\FramingDecoders.cs (19)
134Exception quotaExceeded = OnSizeQuotaExceeded(_encodedSize); 195protected abstract Exception OnSizeQuotaExceeded(int size); 220protected override Exception OnSizeQuotaExceeded(int size) 222Exception result = new InvalidDataException(SR.Format(SR.FramingViaTooLong, size)); 263protected override Exception OnSizeQuotaExceeded(int size) 268public static Exception GetFaultException(string faultString, string via, string contentType) 292Exception inner = new QuotaExceededException(SR.FramingMaxMessageSizeExceeded); 305Exception inner = new QuotaExceededException(SR.Format(SR.FramingContentTypeTooLongFault, contentType)); 310Exception inner = new QuotaExceededException(SR.Format(SR.FramingViaTooLongFault, via)); 335protected override Exception OnSizeQuotaExceeded(int size) 337Exception result = new InvalidDataException(SR.Format(SR.FramingContentTypeTooLong, size)); 396Exception exception = CreateException(new InvalidDataException(SR.Format( 416Exception inner = CreateInvalidRecordTypeException(FramingRecordType.PreambleAck, foundType); 430private Exception CreateInvalidRecordTypeException(FramingRecordType expectedType, FramingRecordType foundType) 439Exception exception = CreateException(new InvalidDataException(SR.Format( 445public Exception CreatePrematureEOFException() 450protected Exception CreateException(InvalidDataException innerException, string framingFault) 452Exception result = CreateException(innerException); 457protected Exception CreateException(InvalidDataException innerException)
System\ServiceModel\Channels\FramingFormat.cs (2)
155public static bool TryGetFaultString(Exception exception, out string framingFault) 170public static void AddFaultString(Exception exception, string framingFault)
System\ServiceModel\Channels\IdlingCommunicationPool.cs (3)
92private Exception _pendingException; 207catch (Exception e) 305Exception exceptionToThrow = _pendingException;
System\ServiceModel\Channels\SessionConnectionReader.cs (2)
25private Exception _pendingException; 132Exception exception = _pendingException;
System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (3)
440Exception e = CreateIdentityCheckException(identity, authorizationContext, SR.IdentityCheckFailedForOutgoingMessage, serviceReference); 446private static Exception CreateIdentityCheckException(EndpointIdentity identity, AuthorizationContext authorizationContext, string errorString, EndpointAddress serviceReference) 448Exception result;
System\ServiceModel\Security\SecurityUtilsEx.cs (1)
167catch (Exception e)
System.ServiceModel.NetNamedPipe (14)
System\IO\PipeException.cs (1)
26public PipeException(string message, Exception inner)
System\ServiceModel\AddressAccessDeniedException.cs (1)
13public AddressAccessDeniedException(string message, Exception innerException) : base(message, innerException) { }
System\ServiceModel\Channels\PipeConnection.cs (6)
86private Exception ConvertPipeException(PipeException pipeException, TransferOperation transferOperation) 91private Exception ConvertPipeException(string exceptionMessage, PipeException pipeException, TransferOperation transferOperation) 415private Exception CreatePipeClosedException(TransferOperation transferOperation) 459Exception exception = ConvertPipeException(new PipeException(SR.PipeSignalExpected), TransferOperation.Read); 483catch(Exception) 487Exception timeoutException = new TimeoutException(SR.Format(SR.PipeWriteTimedOut, timeout));
System\ServiceModel\Channels\PipeConnectionInitiator.cs (6)
31private Exception CreateConnectFailedException(Uri remoteUri, PipeException innerException) 190catch (Exception ex) 198Exception innerException = new PipeException(SR.Format(SR.PipeConnectAddressFailed, 233catch(Exception ex) 319private static Exception CreatePipeNameCannotBeAccessedException(IOException ioe, Uri pipeUri) 321Exception innerException = new PipeException(SR.Format(SR.PipeNameCanNotBeAccessed,
System.ServiceModel.Primitives (23)
netstandard.cs (23)
377public SecurityTokenException(string message, System.Exception innerException) { } 385public SecurityTokenValidationException(string message, System.Exception innerException) { } 421public ActionNotSupportedException(string message, System.Exception innerException) { } 469public ChannelTerminatedException(string message, System.Exception innerException) { } 583public CommunicationException(string message, System.Exception innerException) { } 590public CommunicationObjectAbortedException(string message, System.Exception innerException) { } 597public CommunicationObjectFaultedException(string message, System.Exception innerException) { } 668public EndpointNotFoundException(string message, System.Exception innerException) { } 684public ExceptionDetail(System.Exception exception) { } 850public InvalidMessageContractException(string message, System.Exception innerException) { } 912public MessageHeaderException(string message, System.Exception innerException) : base(default) { } 915public MessageHeaderException(string message, string headerName, string ns, bool isDuplicate, System.Exception innerException) : base(default) { } 916public MessageHeaderException(string message, string headerName, string ns, System.Exception innerException) : base(default) { } 981public ProtocolException(string message, System.Exception innerException) { } 993public QuotaExceededException(string message, System.Exception innerException) { } 1020public ServerTooBusyException(string message, System.Exception innerException) { } 1026public ServiceActivationException(string message, System.Exception innerException) { } 1435protected abstract bool OnTryCreateException(System.ServiceModel.Channels.Message message, System.ServiceModel.Channels.MessageFault fault, out System.Exception exception); 1436protected abstract bool OnTryCreateFaultMessage(System.Exception exception, out System.ServiceModel.Channels.Message message); 1437public bool TryCreateException(System.ServiceModel.Channels.Message message, System.ServiceModel.Channels.MessageFault fault, out System.Exception exception) { exception = default; return default; } 2258public MessageSecurityException(string message, System.Exception innerException) { } 2264public SecurityAccessDeniedException(string message, System.Exception innerException) { } 2276public SecurityNegotiationException(string message, System.Exception innerException) { }
System.ServiceModel.Primitives.Tests (14)
Channels\CustomBindingTest.cs (1)
33catch (Exception ex)
Security\SecurityNegotiationExceptionTest.cs (1)
20Exception innerException = new Exception(exceptionMessage);
ServiceModel\FaultExceptionTest.cs (1)
196Assert.IsAssignableFrom<Exception>(exception);
ServiceModel\ThrowingChannelBase.cs (2)
13private readonly Exception _exception; 15protected ThrowingChannelBase(ChannelManagerBase manager, Exception exception, TChannel innerChannel) : base(manager)
ServiceModel\ThrowingOnCloseBindingElement.cs (9)
13private Exception _exception; 21public ThrowingOnCloseBindingElement(Exception exception, bool channelThrows) 186public ThrowingOutputChannel(ThrowingChannelFactory<TChannel> factory, Exception exception, IOutputChannel innerChannel) 203public ThrowingRequestChannel(ThrowingChannelFactory<TChannel> factory, Exception exception, IRequestChannel innerChannel) 223ThrowingChannelFactory<TChannel> factory, Exception exception, IOutputSessionChannel innerChannel) 236ThrowingChannelFactory<TChannel> factory, Exception exception, IRequestSessionChannel innerChannel) 247public ThrowingInputChannel(ChannelManagerBase manager, Exception exception, T innerChannel) : base(manager, exception, innerChannel) 268public ThrowingDuplexChannel(ChannelManagerBase manager, Exception exception, IDuplexChannel innerChannel) : base(manager, exception, innerChannel) 286public ThrowingDuplexSessionChannel(ChannelManagerBase manager, Exception exception, IDuplexSessionChannel innerChannel) : base(manager, exception, innerChannel)
System.ServiceModel.Syndication (5)
System\ServiceModel\Syndication\SyndicationFeed.cs (1)
151internal Exception LastUpdatedTimeException { get; set; }
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (2)
438catch (Exception e) 464catch (Exception e)
System\ServiceModel\Syndication\SyndicationItem.cs (2)
105internal Exception LastUpdatedTimeException { get; set; } 130internal Exception PublishDateException { get; set; }
System.ServiceModel.UnixDomainSocket (14)
System\ServiceModel\Channels\SocketConnection.cs (14)
208Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Read); 287Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Write); 396Exception exceptionToThrow = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Undefined); 426catch (Exception exception) 449catch (Exception exception) 617private Exception ConvertObjectDisposedException(ObjectDisposedException originalException, TransferOperation transferOperation) 633private Exception ConvertSendException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 639private Exception ConvertReceiveException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout) 645private static Exception ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, 700private static Exception ConvertTimeoutErrorException(Exception originalException, 790public static Exception ConvertConnectException(SocketException socketException, Uri remoteUri, TimeSpan timeSpent, Exception innerException)
System.ServiceProcess.ServiceController (1)
artifacts\obj\System.ServiceProcess.ServiceController\Debug\net10.0\System.ServiceProcess.ServiceController.notsupported.cs (1)
161public TimeoutException(string? message, System.Exception? innerException) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_ServiceController); }
System.Speech (4)
artifacts\obj\System.Speech\Debug\net10.0\System.Speech.notsupported.cs (4)
111internal EmulateRecognizeCompletedEventArgs() : base (default(System.Exception), default(bool), default(object)) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 189internal LoadGrammarCompletedEventArgs() : base (default(System.Exception), default(bool), default(object)) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 207internal RecognizeCompletedEventArgs() : base (default(System.Exception), default(bool), default(object)) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); } 734internal PromptEventArgs() : base (default(System.Exception), default(bool), default(object)) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemSpeech); }
System.Text.Json (22)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
91public override void Complete(Exception? exception = null) => throw new NotImplementedException();
System\Text\Json\JsonException.cs (2)
30public JsonException(string? message, string? path, long? lineNumber, long? bytePositionInLine, Exception? innerException) : base(message, innerException) 61public JsonException(string? message, Exception? innerException) : base(message, innerException)
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (1)
58catch (Exception ex)
System\Text\Json\Serialization\JsonConverterOfT.WriteCore.cs (1)
18catch (Exception ex)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
271catch (Exception ex)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
729catch (Exception e)
System\Text\Json\Serialization\WriteStack.cs (9)
284Exception? exception = null; 292catch (Exception e) 312Exception? exception = null; 329static void DisposeFrame(IEnumerator? collectionEnumerator, ref Exception? exception) 338catch (Exception e) 351Exception? exception = null; 366static async ValueTask<Exception?> DisposeFrame(IEnumerator? collectionEnumerator, IAsyncDisposable? asyncDisposable, Exception? exception) 381catch (Exception e)
System\Text\Json\ThrowHelper.cs (1)
585public static InvalidOperationException GetInvalidOperationException(string message, Exception? innerException)
System\Text\Json\ThrowHelper.Serialization.cs (5)
456public static void ReThrowWithPath(scoped ref ReadStack state, in Utf8JsonReader reader, Exception ex) 494public static void ReThrowWithPath(ref WriteStack state, Exception ex) 567public static void ThrowNotSupportedException(scoped ref ReadStack state, in Utf8JsonReader reader, Exception innerException) 595public static void ThrowNotSupportedException(ref WriteStack state, Exception innerException) 835public static Exception GetInvalidOperationException_NoMetadataForTypeProperties(IJsonTypeInfoResolver? resolver, Type type)
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (1)
52public RegexMatchTimeoutException(string message, Exception inner) : base(message ?? SR.RegexMatchTimeoutException_Occurred, inner) { }
System.Text.RegularExpressions.Generator (2)
RegexGenerator.cs (1)
78catch (Exception e)
RegexGenerator.Parser.cs (1)
155catch (Exception e)
System.Threading (8)
System\Threading\Barrier.cs (4)
40public BarrierPostPhaseException(Exception? innerException) 59public BarrierPostPhaseException(string? message, Exception? innerException) 145private Exception? _exception; 786catch (Exception ex)
System\Threading\ReaderWriterLock.cs (4)
1119/// out-of-memory scenarios. <see cref="Exception.HResult"/> property was set to a specific value to indicate the actual 1125/// <see cref="ReaderWriterLockApplicationException"/> is thrown with the same <see cref="Exception.HResult"/> as 1150/// The original code used an incorrect <see cref="Exception.HResult"/> for this exception. The 1151/// <see cref="Exception.HResult"/> value was set to ERROR_NOT_OWNER without first converting that error code into an
System.Threading.Channels (26)
System\Threading\Channels\AsyncOperation.cs (1)
341public bool TrySetException(Exception exception)
System\Threading\Channels\BoundedChannel.cs (2)
37private Exception? _doneWriting; 311public override bool TryComplete(Exception? error)
System\Threading\Channels\ChannelClosedException.cs (2)
19public ChannelClosedException(Exception? innerException) : 25public ChannelClosedException(string? message, Exception? innerException) : base(message ?? SR.ChannelClosedException_DefaultMessage, innerException) { }
System\Threading\Channels\ChannelReader.cs (1)
72catch (Exception exc) when (!(exc is ChannelClosedException || exc is OperationCanceledException))
System\Threading\Channels\ChannelUtilities.cs (7)
14internal static readonly Exception s_doneWritingSentinel = new Exception(nameof(s_doneWritingSentinel)); 30internal static void Complete(TaskCompletionSource tcs, Exception? error = null) 57internal static ValueTask<T> GetInvalidCompletionValueTask<T>(Exception error) 84internal static void WakeUpWaiters(ref AsyncOperation<bool>? listTail, bool result, Exception? error = null) 110internal static void FailOperations<T, TInner>(Deque<T> operations, Exception error) where T : AsyncOperation<TInner> 120internal static Exception CreateInvalidCompletionException(Exception? inner = null) =>
System\Threading\Channels\ChannelWriter.cs (4)
15/// <param name="error">An <see cref="Exception"/> indicating the failure causing no more data to be written, or null for success.</param> 20public virtual bool TryComplete(Exception? error = null) => false; 48catch (Exception e) 70public void Complete(Exception? error = null)
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (3)
32private volatile Exception? _doneWriting; 209public override bool TryComplete(Exception? error) 342Exception? doneWriting = _parent._doneWriting;
System\Threading\Channels\UnboundedChannel.cs (3)
29private Exception? _doneWriting; 201public override bool TryComplete(Exception? error) 303Exception? doneWriting = _parent._doneWriting;
System\Threading\Channels\UnboundedPriorityChannel.cs (3)
34private Exception? _doneWriting; 206public override bool TryComplete(Exception? error) 308Exception? doneWriting = _parent._doneWriting;
System.Threading.RateLimiting (24)
System\Threading\RateLimiting\ChainedPartitionedRateLimiter.cs (13)
62Exception? exception = null; 67catch (Exception ex) 88Exception? exception = null; 93catch (Exception ex) 120private static RateLimitLease? CommonAcquireLogic(Exception? ex, RateLimitLease? lease, ref RateLimitLease[]? leases, int index, int length) 127Exception[] exceptions = new Exception[innerEx.InnerExceptions.Count + 1]; 148List<Exception>? exceptions = null; 156catch (Exception ex) 158exceptions ??= new List<Exception>(); 234List<Exception>? exceptions = null; 244catch (Exception ex) 246exceptions ??= new List<Exception>();
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (11)
124List<Exception>? exceptions = null; 134catch (Exception ex) 136exceptions ??= new List<Exception>(); 162List<Exception>? exceptions = null; 169catch (Exception ex) 171exceptions ??= new List<Exception>(); 225List<Exception>? aggregateExceptions = null; 260catch (Exception ex) 262aggregateExceptions ??= new List<Exception>(); 274catch (Exception ex) 276aggregateExceptions ??= new List<Exception>();
System.Threading.Tasks.Dataflow (142)
Base\DataflowBlock.cs (28)
200void IDataflowBlock.Fault(Exception exception) { _target.Fault(exception); } 351catch (Exception exc) 482private void CompleteAsFaulted(Exception exception, bool runAsync) 486var tuple = (Tuple<SendAsyncSource<TOutput>, Exception>)state!; 489}, Tuple.Create<SendAsyncSource<TOutput>, Exception>(this, exception), runAsync); 634catch (Exception exc) 740void IDataflowBlock.Fault(Exception exception) { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } 1029catch (Exception exc) 1123catch (Exception exception) 1170internal Exception? _receivedException; 1209catch (Exception exc) 1280catch (Exception exc) 1368internal static Exception CreateExceptionForSourceCompletion() 1375internal static Exception CreateExceptionForTimeout() 1387void IDataflowBlock.Fault(Exception exception) { ((IDataflowBlock)this).Complete(); } 1507void IDataflowBlock.Fault(Exception exception) 1582void IDataflowBlock.Fault(Exception exception) 1928catch (Exception exc) 2027List<Exception>? exceptions = null; 2099catch (Exception exc) 2213void IDataflowBlock.Fault(Exception exception) { ((IDataflowBlock)this).Complete(); } 2314Exception? error = null; 2537catch (Exception exc) 2553private void NotifyObserversOfCompletion(Exception? targetException = null) 2574Exception? error = targetException ?? Observable.GetCompletionError(); 2587catch (Exception exc) 2650void IObserver<TInput>.OnError(Exception error) 2719void IDataflowBlock.Fault(Exception exception) { } // No-op
Base\IDataflowBlock.cs (1)
29void Fault(Exception exception);
Blocks\ActionBlock.cs (4)
141catch (Exception exc) 164Exception? caughtException = null; 169catch (Exception exc) { caughtException = exc; } 238void IDataflowBlock.Fault(Exception exception)
Blocks\BatchBlock.cs (10)
102void IDataflowBlock.Fault(Exception exception) 428internal void Complete(Exception? exception, bool dropPendingMessages, bool releaseReservedMessages, bool revertProcessingState = false) 452catch (Exception e) { _owningBatch._source.AddException(e); } 530List<Exception>? exceptions = null; 653Exception? exception = Common.StartTaskSafe(_nonGreedyState.TaskForInputProcessing, _dataflowBlockOptions.TaskScheduler); 657Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, releaseReservedMessages: true, revertProcessingState: true), 702catch (Exception exc) 1089List<Exception>? exceptions = null; 1101catch (Exception e) 1104exceptions ??= new List<Exception>(1);
Blocks\BatchedJoinBlock.cs (5)
157void IDataflowBlock.Fault(Exception exception) 414void IDataflowBlock.Fault(Exception exception) 617void IDataflowBlock.Fault(Exception exception) 683Action<Exception> exceptionAction, Action completionAction) 739internal readonly Action<Exception> _exceptionAction;
Blocks\BroadcastBlock.cs (13)
115void IDataflowBlock.Fault(Exception exception) 125internal void CompleteCore(Exception? exception, bool storeExceptionEvenIfAlreadyCompleting, bool revertProcessingState = false) 272Exception? exception = Common.StartTaskSafe(_boundingState.TaskForInputProcessing, _source.DataflowBlockOptions.TaskScheduler); 276Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 299catch (Exception exception) 393List<Exception>? exceptions = null; 536private List<Exception>? _exceptions; 848Exception? exception = Common.StartTaskSafe(_taskForOutputProcessing, _dataflowBlockOptions.TaskScheduler); 892catch (Exception exception) 963List<Exception>? exceptions; 1160internal void AddException(Exception exception) 1172internal void AddExceptions(List<Exception> exceptions) 1178foreach (Exception exception in exceptions)
Blocks\BufferBlock.cs (6)
150void IDataflowBlock.Fault(Exception exception) 160private void CompleteCore(Exception? exception, bool storeExceptionEvenIfAlreadyCompleting, bool revertProcessingState = false) 273Exception? exception = Common.StartTaskSafe(_boundingState.TaskForInputProcessing, _source.DataflowBlockOptions.TaskScheduler); 277Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 301catch (Exception exc) 396List<Exception>? exceptions = null;
Blocks\JoinBlock.cs (12)
144void IDataflowBlock.Fault(Exception exception) 371void IDataflowBlock.Fault(Exception exception) 802List<Exception>? exceptions = null; 813foreach (Exception exc in exceptions) 895internal override void CompleteCore(Exception? exception, bool dropPendingMessages, bool releaseReservedMessages) 923catch (Exception e) { _sharedResources._exceptionAction(e); } 937void IDataflowBlock.Fault(Exception exception) 1019internal abstract void CompleteCore(Exception? exception, bool dropPendingMessages, bool releaseReservedMessages); 1040Action joinFilledAction, Action<Exception> exceptionAction, 1065internal readonly Action<Exception> _exceptionAction; 1294Exception? exception = Common.StartTaskSafe(_taskForInputProcessing, _dataflowBlockOptions.TaskScheduler); 1393catch (Exception exception)
Blocks\TransformBlock.cs (4)
184catch (Exception exc) 232Exception? caughtException = null; 237catch (Exception exc) { caughtException = exc; } 336void IDataflowBlock.Fault(Exception exception)
Blocks\TransformManyBlock.cs (5)
180catch (Exception exc) when (Common.IsCooperativeCancellation(exc)) 199Exception? caughtException = null; 204catch (Exception exc) { caughtException = exc; } 268catch (Exception exc) 548void IDataflowBlock.Fault(Exception exception)
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
65catch (Exception exc)
Blocks\WriteOnceBlock.cs (13)
112private void CompleteBlockAsync(IList<Exception>? exceptions) 134Exception? exception = Common.StartTaskSafe(taskForOutputProcessing, _dataflowBlockOptions.TaskScheduler); 142Tuple<WriteOnceBlock<T>, IList<Exception>> blockAndList = (Tuple<WriteOnceBlock<T>, IList<Exception>>)state!; 159List<Exception>? exceptions = OfferToTargets(); 167private void CompleteBlock(IList<Exception>? exceptions) 209void IDataflowBlock.Fault(Exception exception) 225private void CompleteCore(Exception? exception, bool storeExceptionEvenIfAlreadyCompleting) 250List<Exception>? exceptions = null; 253exceptions = new List<Exception>(); 453private List<Exception>? OfferToTargets() 460List<Exception>? exceptions = null; 477catch (Exception exc)
Internal\Common.cs (21)
139catch (Exception exception) 150internal static bool IsCooperativeCancellation(Exception exception) 212internal static Exception InitializeStackTrace(Exception exception) 228internal static void StoreDataflowMessageValueIntoExceptionData<T>(Exception exc, T messageValue, bool targetInnerExceptions = false) 254foreach (Exception innerException in aggregate.InnerExceptions) 272private static void StoreStringIntoExceptionData(Exception exception, string key, string value) 300internal static void ThrowAsync(Exception error) 311internal static void AddException([NotNull] ref List<Exception>? list, Exception exception, bool unwrapInnerExceptions = false) 318list ??= new List<Exception>(); 362internal static Task<TResult> CreateTaskFromException<TResult>(Exception exception) 452internal static Exception? StartTaskSafe(Task task, TaskScheduler scheduler) 470private static Exception? StartTaskSafeCore(Task task, TaskScheduler scheduler) 475Exception? schedulingException = null; 481catch (Exception caughtException) 499ref List<Exception>? exceptions) 525catch (Exception exc) 538internal static readonly Action<Exception> AsyncExceptionHandler = ThrowAsync; 546internal static void PropagateCompletion(Task sourceCompletionTask, IDataflowBlock target, Action<Exception>? exceptionHandler) 559catch (Exception exc)
Internal\SourceCore.cs (7)
91private List<Exception>? _exceptions; // Protected by ValueLock, sometimes read with volatile reads 460internal void AddException(Exception exception) 472internal void AddExceptions(List<Exception> exceptions) 478foreach (Exception exception in exceptions) 770Exception? exception = Common.StartTaskSafe(_taskForOutputProcessing, _dataflowBlockOptions.TaskScheduler); 843catch (Exception exc) 937List<Exception>? exceptions;
Internal\SpscTargetCore.cs (6)
56private volatile List<Exception>? _exceptions; 219catch (Exception exc) 286internal void Complete(Exception? exception) 304private void StoreException(Exception exception) 312lock (LazyInitializer.EnsureInitialized(ref _exceptions, static () => new List<Exception>())) 333Exception[] exceptions;
Internal\TargetCore.cs (5)
84private List<Exception>? _exceptions; 140internal void Complete(Exception? exception, bool dropPendingMessages, bool storeExceptionEvenIfAlreadyCompleting = false, 384Exception? exception = Common.StartTaskSafe(taskForInputProcessing, _dataflowBlockOptions.TaskScheduler); 388Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, storeExceptionEvenIfAlreadyCompleting: true, 482catch (Exception exc)
Internal\TargetRegistry.cs (1)
350void IDataflowBlock.Fault(Exception exception) { _target.Fault(exception); }
System.Threading.Tasks.Parallel (28)
System\Threading\Tasks\Parallel.cs (15)
253ConcurrentQueue<Exception>? exceptionQ = null; // will be lazily initialized if necessary 280catch (Exception e) 282LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); }); 296catch (Exception e) 298LazyInitializer.EnsureInitialized<ConcurrentQueue<Exception>>(ref exceptionQ, () => { return new ConcurrentQueue<Exception>(); }); 314foreach (Exception exc in ae.InnerExceptions) exceptionQ.Enqueue(exc); 1092catch (Exception ex) 2725catch (Exception ex) 2818Exception? first = null; 2821Debug.Assert(exObj is Exception); 2822Exception ex = (Exception)exObj; 2845Exception otherException)
System\Threading\Tasks\Parallel.ForEachAsync.cs (11)
159catch (Exception e) 185catch (Exception e) 304catch (Exception e) 319catch (Exception e) 340catch (Exception e) 459catch (Exception e) 474catch (Exception e) 495catch (Exception e) 530private List<Exception>? _exceptions; 614public void RecordException(Exception e) 619(_exceptions ??= new List<Exception>()).Add(e);
System\Threading\Tasks\TaskReplicator.cs (2)
22private ConcurrentQueue<Exception>? _exceptions; 88catch (Exception ex)
System.Transactions.Local (86)
System\Transactions\DurableEnlistmentState.cs (6)
118internal override void Aborted(InternalEnlistment enlistment, Exception? e) 197internal override void Aborted(InternalEnlistment enlistment, Exception? e) 207internal override void InDoubt(InternalEnlistment enlistment, Exception? e) 244internal override void Aborted(InternalEnlistment enlistment, Exception? e) 256internal override void InDoubt(InternalEnlistment enlistment, Exception? e) 289internal override void InDoubt(InternalEnlistment enlistment, Exception? e)
System\Transactions\Enlistment.cs (3)
18void ForceRollback(Exception? e); 24void Aborted(Exception? e); 28void InDoubt(Exception? e);
System\Transactions\EnlistmentState.cs (6)
32internal virtual void ForceRollback(InternalEnlistment enlistment, Exception? e) 42internal virtual void Aborted(InternalEnlistment enlistment, Exception? e) 47internal virtual void InDoubt(InternalEnlistment enlistment, Exception? e) 141internal override void ForceRollback(InternalEnlistment enlistment, Exception? e) 169internal override void Aborted(InternalEnlistment enlistment, Exception? e) 183internal override void InDoubt(InternalEnlistment enlistment, Exception? e)
System\Transactions\InternalTransaction.cs (1)
136internal Exception? _innerException;
System\Transactions\NonWindowsUnsupported.cs (3)
46internal static Exception NotSupported() 72internal Exception? InnerException { get; set; } 120internal static Exception NotSupported()
System\Transactions\PreparingEnlistment.cs (1)
54public void ForceRollback(Exception? e)
System\Transactions\SinglePhaseEnlistment.cs (2)
32public void Aborted(Exception? e) 99public void InDoubt(Exception? e)
System\Transactions\Transaction.cs (1)
587public void Rollback(Exception? e)
System\Transactions\TransactionException.cs (24)
22internal static TransactionException Create(string? message, Exception? innerException) 33internal static TransactionException CreateTransactionStateException(Exception? innerException) 38internal static Exception CreateEnlistmentStateException(Exception? innerException, Guid distributedTxId) 52internal static Exception CreateInvalidOperationException(TraceSourceType traceSource, string? message, Exception? innerException) 83public TransactionException(string? message, Exception? innerException) : base(message, innerException) 107internal static TransactionException Create(string? message, Exception? innerException, Guid distributedTxId) 116internal static TransactionException CreateTransactionStateException(Exception? innerException, Guid distributedTxId) 121internal static Exception CreateTransactionCompletedException(Guid distributedTxId) 136internal static Exception CreateInvalidOperationException(TraceSourceType traceSource, string? message, Exception? innerException, Guid distributedTxId) 154internal static new TransactionAbortedException Create(string? message, Exception? innerException, Guid distributedTxId) 163internal static new TransactionAbortedException Create(string? message, Exception? innerException) 193public TransactionAbortedException(string? message, Exception? innerException) : base(message ?? SR.TransactionAborted, innerException) 201internal TransactionAbortedException(Exception? innerException) : base(SR.TransactionAborted, innerException) 205internal TransactionAbortedException(Exception? innerException, Guid distributedTxId) : 231internal static TransactionInDoubtException Create(TraceSourceType traceSource, string? message, Exception? innerException, Guid distributedTxId) 240internal static TransactionInDoubtException Create(TraceSourceType traceSource, string? message, Exception? innerException) 271public TransactionInDoubtException(string? message, Exception? innerException) : base(message ?? SR.TransactionIndoubt, innerException) 294internal static new TransactionManagerCommunicationException Create(string? message, Exception? innerException) 305internal static TransactionManagerCommunicationException Create(Exception? innerException) 332Exception? innerException 373public TransactionPromotionException(string? message, Exception? innerException) : base(message ?? SR.PromotionFailed, innerException)
System\Transactions\TransactionScope.cs (1)
531Exception? exToThrow = null;
System\Transactions\TransactionsEtwProvider.cs (2)
918internal void ExceptionConsumed(TraceSourceType traceSource, Exception exception) 939internal void ExceptionConsumed(Exception exception)
System\Transactions\TransactionState.cs (31)
190internal virtual void Rollback(InternalTransaction tx, Exception? e) 297internal virtual void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 695internal override void Rollback(InternalTransaction tx, Exception? e) 838internal override void Rollback(InternalTransaction tx, Exception? e) 1037internal override void Rollback(InternalTransaction tx, Exception? e) 1150internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 1219internal override void Rollback(InternalTransaction tx, Exception? e) 1224internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 1285internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 1329internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 1423internal override void Rollback(InternalTransaction tx, Exception? e) 1461internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 1555internal override void Rollback(InternalTransaction tx, Exception? e) 1618internal override void Rollback(InternalTransaction tx, Exception? e) 1801internal override void Rollback(InternalTransaction tx, Exception? e) 2445internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 2558internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 2632internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 2735internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 2960internal override void Rollback(InternalTransaction tx, Exception? e) 3018internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 3379internal override void Rollback(InternalTransaction tx, Exception? e) 3489internal override void Rollback(InternalTransaction tx, Exception? e) 3580internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 3686internal override void Rollback(InternalTransaction tx, Exception? e) 3782internal override void Rollback(InternalTransaction tx, Exception? e) 3866internal override void Rollback(InternalTransaction tx, Exception? e) 3884internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 4062internal override void Rollback(InternalTransaction tx, Exception? e) 4092internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception? e) 4300internal override void Rollback(InternalTransaction tx, Exception? e)
System\Transactions\VolatileEnlistmentState.cs (5)
174internal override void ForceRollback(InternalEnlistment enlistment, Exception? e) 252internal override void Aborted(InternalEnlistment enlistment, Exception? e) 260internal override void InDoubt(InternalEnlistment enlistment, Exception? e) 331internal override void ForceRollback(InternalEnlistment enlistment, Exception? e) 502internal override void InDoubt(InternalEnlistment enlistment, Exception? e)
System.Windows.Forms (232)
misc\MultitargetUtil.cs (1)
30catch (Exception e) when (!e.IsCriticalException())
System\Resources\ResXDataNode.cs (4)
259catch (Exception ex) when (!ex.IsCriticalException()) 306catch (Exception ex) when (!ex.IsCriticalException()) 439catch (Exception ex) when (!ex.IsCriticalException()) 566catch (Exception ex)
System\Resources\ResXResourceReader.cs (1)
394catch (Exception e)
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (1)
176catch (Exception ex)
System\Windows\Forms\ActiveX\AxHost.AxPerPropertyBrowsingEnum.cs (1)
120catch (Exception ex)
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (3)
149catch (Exception t) 172catch (Exception) 365catch (Exception)
System\Windows\Forms\ActiveX\AxHost.AxPropertyTypeEditor.cs (1)
36catch (Exception ex)
System\Windows\Forms\ActiveX\AxHost.ConnectionPointCookie.cs (1)
51catch (Exception ex)
System\Windows\Forms\ActiveX\AxHost.cs (11)
1458catch (Exception t) 1605catch (Exception t) 1779catch (Exception t) 1921catch (Exception) 2419catch (Exception) 2880catch (Exception t) 2897catch (Exception t) 3376catch (Exception t) 3394catch (Exception ex) 3714catch (Exception) 3802catch (Exception)
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (1)
523catch (Exception ex)
System\Windows\Forms\ActiveX\AxHost.PropertyBagStream.cs (3)
34catch (Exception ex) when (!ex.IsCriticalException()) 51catch (Exception inner) when (!inner.IsCriticalException()) 112catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\ActiveX\AxHost.State.cs (3)
104catch (Exception e) 120catch (Exception e) 356catch (Exception)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (5)
1084catch (Exception e) 1104catch (Exception ex) 1137catch (Exception ex) when (!ex.IsCriticalException()) 1379catch (Exception e) when (!e.IsCriticalException()) 1524catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\ActiveX\Control.ActiveXImpl.PropertyBagStream.cs (1)
35catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
180catch (Exception ex)
System\Windows\Forms\Application.cs (2)
389catch (Exception ex) when (!ex.IsCriticalException()) 1234public static void OnThreadException(Exception t)
System\Windows\Forms\Application.ThreadContext.cs (2)
594internal void OnThreadException(Exception ex) 975catch (Exception e)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ComponentEditor.cs (1)
125catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (3)
214catch (Exception ex) 232catch (Exception ex) 242catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (1)
149catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (3)
502catch (Exception ex) 542catch (Exception ex) 650catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (1)
51catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (3)
533catch (Exception ex) when (!ex.IsCriticalException()) 752catch (Exception ex) when (!ex.IsCriticalException()) 810catch (Exception ex)
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (1)
156catch (Exception ex)
System\Windows\Forms\Control.ControlCollection.cs (1)
222catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Control.ControlNativeWindow.cs (1)
55protected override void OnThreadException(Exception e)
System\Windows\Forms\Control.cs (10)
3506Exception ex = new ObjectDisposedException(GetType().Name); 4654Exception ex = new ObjectDisposedException(GetType().Name); 6133catch (Exception t) 6538private protected virtual bool SuppressApplicationOnThreadException(Exception ex) => false; 7473catch (Exception ex) when (!ex.IsCriticalException()) 8451catch (Exception e) 9208catch (Exception) 9492catch (Exception e) 11244catch (Exception e) 11780catch (Exception ex) when (!ex.IsCriticalException() || ex is OutOfMemoryException)
System\Windows\Forms\Control.ThreadMethodEntry.cs (1)
18internal Exception? _exception;
System\Windows\Forms\Control_InvokeAsync.cs (4)
60catch (Exception ex) 126catch (Exception ex) 191catch (Exception ex) 249catch (Exception ex)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildNativeWindow.cs (1)
151catch (Exception e)
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (7)
1122catch (Exception exception) when (!exception.IsCriticalException() || exception is IndexOutOfRangeException) 1148catch (Exception exception) when (!exception.IsCriticalException() || exception is IndexOutOfRangeException) 1180catch (Exception exception) when (!exception.IsCriticalException() || exception is IndexOutOfRangeException) 1364catch (Exception exception) when (!exception.IsCriticalException()) 1417catch (Exception exception) when (!exception.IsCriticalException()) 1432public void ProcessException(Exception exception, DataGridViewCellCancelEventArgs e, bool beginEdit) 1492catch (Exception exception) when (!exception.IsCriticalException())
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (8)
3099catch (Exception exception) when (!exception.IsCriticalException()) 3915if (!PushFormattedValue(ref dataGridViewCurrentCell!, formattedValue, out Exception? exception)) 9705catch (Exception exception) when (!exception.IsCriticalException()) 9737catch (Exception exception) when (!exception.IsCriticalException()) 16728catch (Exception ex) when (!ex.IsCriticalException()) 19997catch (Exception exception) when (!exception.IsCriticalException()) 25349private bool PushFormattedValue(ref DataGridViewCell dataGridViewCurrentCell, object? formattedValue, out Exception? exception) 25390catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
1626catch (Exception exception) when (!exception.IsCriticalException()) 1656Exception exception;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
161catch (Exception exception) when (!exception.IsCriticalException()) 171catch (Exception exception) when (!exception.IsCriticalException())
System\Windows\Forms\Controls\DataGridView\DataGridViewDataErrorEventArgs.cs (2)
11Exception? exception, 23public Exception? Exception { get; }
System\Windows\Forms\Controls\ListControl\ListControl.cs (1)
565catch (Exception exception) when (!exception.IsCriticalException())
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2923catch (Exception e) 6024catch (Exception e)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (6)
585catch (Exception error) 604private void PostCompleted(Exception? error, bool cancelled) 625catch (Exception error) 673catch (Exception error) 731catch (Exception error) 1120catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (12)
237catch (Exception ex) when (!ex.IsCriticalException()) 1555catch (Exception e) 1649catch (Exception exception) 1686catch (Exception exception) 2041catch (Exception e) 2116catch (Exception ex) 3184catch (Exception ex) 3510catch (Exception e) 3872catch (Exception) 3881catch (Exception) 3940catch (Exception ex) 3957catch (Exception)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (1)
124catch (Exception ex)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (5)
1100catch (Exception e) 1378catch (Exception w) 1407catch (Exception e) 1451catch (Exception t) 2064catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\HelpPane.cs (1)
234catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ImmutablePropertyDescriptorGridEntry.cs (1)
74catch (Exception e)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (1)
145catch (Exception e)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.cs (1)
83catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (1)
207catch (Exception e)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.ExceptionConverter.cs (1)
20if (value is Exception ex)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.ExceptionEditor.cs (1)
19if (value is Exception ex)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (12)
948catch (Exception e) 1134catch (Exception ex) 1179catch (Exception ex) 1254catch (Exception ex) 1685catch (Exception ex) 1751catch (Exception e) 3335catch (Exception ex) when (!ex.IsCriticalException()) 3362catch (Exception ex) when (!ex.IsCriticalException()) 4666catch (Exception ex) 4739catch (Exception ex) 4891private unsafe void ShowFormatExceptionMessage(Exception? ex) 4963internal unsafe void ShowInvalidMessage(Exception? ex)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.PropertyGridViewAccessibleObject.cs (2)
267catch (Exception ex) 298catch (Exception ex)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (3)
2343catch (Exception exception) when (!exception.IsCriticalException()) 2744catch (Exception ex) when (!ex.IsCriticalException()) 2883catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
182catch (Exception e)
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
290catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (1)
1023catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
270catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (7)
180catch (Exception ex) when (!ex.IsCriticalException()) 205catch (Exception ex) when (!ex.IsCriticalException()) 230catch (Exception ex) when (!ex.IsCriticalException()) 255catch (Exception ex) when (!ex.IsCriticalException()) 280catch (Exception ex) when (!ex.IsCriticalException()) 559catch (Exception ex) when (!ex.IsCriticalException()) 670catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (1)
622catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\WebBrowser\HtmlShim.cs (1)
103catch (Exception ex)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (11)
639catch (Exception ex) when (!ex.IsCriticalException()) 661catch (Exception ex) when (!ex.IsCriticalException()) 819catch (Exception ex) when (!ex.IsCriticalException()) 843catch (Exception ex) when (!ex.IsCriticalException()) 870catch (Exception ex) when (!ex.IsCriticalException()) 908catch (Exception ex) when (!ex.IsCriticalException()) 924catch (Exception ex) when (!ex.IsCriticalException()) 939catch (Exception ex) when (!ex.IsCriticalException()) 955catch (Exception ex) when (!ex.IsCriticalException()) 971catch (Exception ex) when (!ex.IsCriticalException()) 986catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (3)
349catch (Exception ex) when (!ex.IsCriticalException()) 944catch (Exception t) 987catch (Exception t)
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (2)
340catch (Exception t) 386catch (Exception)
System\Windows\Forms\DataBinding\Binding.cs (7)
592private BindingCompleteEventArgs CreateBindingCompleteEventArgs(BindingCompleteContext context, Exception? ex) 629catch (Exception ex) when (!ex.IsCriticalException()) 838Exception? lastException = null; 880catch (Exception ex) 920catch (Exception ex) when (FormattingEnabled) 967Exception? lastException = null; 997catch (Exception ex) when (FormattingEnabled)
System\Windows\Forms\DataBinding\BindingCompleteEventArgs.cs (3)
21Exception? exception, 40Exception? exception) 76public Exception? Exception { get; }
System\Windows\Forms\DataBinding\BindingManagerBase.cs (1)
54protected internal void OnDataError(Exception e)
System\Windows\Forms\DataBinding\BindingManagerDataErrorEventArgs.cs (2)
8public BindingManagerDataErrorEventArgs(Exception exception) 13public Exception Exception { get; }
System\Windows\Forms\DataBinding\BindingSource.cs (1)
531Exception? instanceException = null;
System\Windows\Forms\DataBinding\CurrencyManager.cs (6)
412catch (Exception ex) 430catch (Exception ex) 499catch (Exception ex) 869catch (Exception ex) 900catch (Exception ex) 928catch (Exception ex)
System\Windows\Forms\DataBinding\ListBindingHelper.cs (1)
246Exception? instanceException = null;
System\Windows\Forms\DataBinding\RelatedCurrencyManager.cs (1)
153catch (Exception ex)
System\Windows\Forms\Design\IUIService.cs (2)
54void ShowError(Exception ex); 59void ShowError(Exception ex, string message);
System\Windows\Forms\Design\PropertyTab.cs (1)
51catch (Exception)
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (1)
136catch (Exception e)
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (1)
420catch (Exception e)
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (1)
153catch (Exception e)
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
336catch (Exception e)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (4)
428catch (Exception ex) 1176catch (Exception ex) when (CanCatchCallbackException()) 1602catch (Exception ex) when (ex is InvalidOperationException or Win32Exception) 1661private static void HandleCallbackException(Exception e) => Application.OnThreadException(e);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.WindowSubclassHandler.cs (2)
37protected override bool CanCatchWndProcException(Exception ex) => CanCatchCallbackException(); 39protected override void HandleWndProcException(Exception ex) => HandleCallbackException(ex);
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
74public ThreadExceptionDialog(Exception t)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
205protected override void OnThreadException(Exception e)
System\Windows\Forms\Form.cs (6)
3162catch (Exception e) 4034catch (Exception ex) 5518catch (Exception ex) 5535catch (Exception ex) 5542private protected override bool SuppressApplicationOnThreadException(Exception ex) 5835catch (Exception ex)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (2)
1583catch (Exception e) 1652catch (Exception e)
System\Windows\Forms\Layout\TableLayout.SorterObjectArray.cs (2)
37catch (Exception) 81catch (Exception)
System\Windows\Forms\NativeWindow.cs (2)
358catch (Exception e) 642protected virtual void OnThreadException(Exception e)
System\Windows\Forms\NotifyIcon.NotifyIconNativeWindow.cs (1)
55protected override void OnThreadException(Exception e)
System\Windows\Forms\Rendering\DCMapping.cs (1)
102catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Timer.cs (1)
329protected override void OnThreadException(Exception e)
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
549catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\WindowSubclassHandler.cs (5)
240/// <see cref="HandleWndProcException(Exception)"/>. 246protected virtual bool CanCatchWndProcException(Exception exception) 255/// <param name="exception">The <see cref="Exception"/> that was caught.</param> 256protected virtual void HandleWndProcException(Exception exception) 275catch (Exception ex) when (CanCatchWndProcException(ex))
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.cs (1)
87catch (Exception ex)
System.Windows.Forms.Design (122)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (4)
283catch (Exception ex) 305catch (Exception e) 704catch (Exception ex) 900catch (Exception ex)
System\ComponentModel\Design\CollectionEditor.CollectionForm.cs (2)
103catch (Exception ex) when (!ex.IsCriticalException()) 149protected virtual void DisplayError(Exception e)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
44catch (Exception ex)
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
64catch (Exception ex)
System\ComponentModel\Design\DesignerActionPanel.PropertyLine.cs (1)
78catch (Exception e)
System\ComponentModel\Design\DesignerHost.cs (8)
162catch (Exception t) 340catch (Exception e) 716List<Exception> exceptions = []; 733catch (Exception e) 743catch (Exception e) 758catch (Exception e) 768catch (Exception e) 1114catch (Exception ex)
System\ComponentModel\Design\DesignSurface.cs (2)
138if (o is Exception ex) 447Exception ex = new InvalidOperationException(SR.DesignSurfaceNoRootComponent)
System\ComponentModel\Design\ExceptionCollection.cs (5)
11private readonly List<Exception>? _exceptions; 20if (exceptions.ToArray().Any(e => e is not Exception)) 22throw new ArgumentException(string.Format(SR.ExceptionCollectionInvalidArgument, nameof(Exception)), nameof(exceptions)); 25_exceptions = exceptions?.Cast<Exception>().ToList(); 28internal ExceptionCollection(List<Exception>? exceptions)
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (6)
144Exception ex = new InvalidOperationException(SR.BasicDesignerLoaderAlreadyLoaded) 154Exception ex = new InvalidOperationException(SR.BasicDesignerLoaderDifferentHost) 212catch (Exception e) 314catch (Exception ex) 863Exception? ex = lastError as Exception;
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (1)
322catch (Exception ex)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (7)
139catch (Exception ex) 200Exception ex = new NotSupportedException(SR.CodeDomDesignerLoaderNoLanguageSupport) 346Exception ex; 971Exception ex = new ArgumentException(SR.CodeDomDesignerLoaderBadSerializationObject) 1185Exception ex = new ArgumentException(SR.CodeDomDesignerLoaderInvalidBlankIdentifier) 1218Exception ex = new ArgumentException(string.Format(SR.CodeDomDesignerLoaderInvalidIdentifier, name)) 1261Exception ex = new ArgumentException(string.Format(SR.CodeDomDesignerLoaderDupComponentName, name))
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (4)
171Exception exception = new CodeDomSerializerException(exceptionText, linePragma) 390catch (Exception e) 448catch (Exception e) 982catch (Exception ex)
System\ComponentModel\Design\Serialization\CodeDomSerializerException.cs (2)
19public CodeDomSerializerException(Exception? ex, CodeLinePragma? linePragma) : base(ex?.Message, ex) 29public CodeDomSerializerException(Exception? ex, IDesignerSerializationManager manager) : base(ex?.Message, ex)
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (1)
490catch (Exception ex)
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
751Exception ex = new SerializationException(string.Format(SR.SerializationManagerDuplicateComponentDecl, name))
System\ComponentModel\Design\Serialization\EventMemberCodeDomSerializer.cs (1)
61catch (Exception e)
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (2)
52catch (Exception e) 113catch (Exception e)
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (3)
253catch (Exception e) 261Exception se = culture == CultureInfo.InvariantCulture 263: (Exception)new SerializationException(string.Format(SR.SerializerResourceException, culture.ToString(), message), e);
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (1)
318catch (Exception ex)
System\ComponentModel\Design\SiteNestedContainer.cs (1)
57catch (Exception t)
System\ComponentModel\Design\UndoEngine.cs (1)
288Exception ex = new InvalidOperationException(string.Format(SR.UndoEngineMissingService, serviceType.Name))
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (1)
104catch (Exception ex)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
576private void ShowError(Exception ex)
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (1)
98catch (Exception e)
System\Windows\Forms\Design\CommandSet.CommandSetItem.cs (1)
183catch (Exception e)
System\Windows\Forms\Design\CommandSet.cs (2)
338catch (Exception ex) when (!ex.IsCriticalException()) 545catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Design\ComponentTray.cs (6)
831protected void DisplayError(Exception e) 1089catch (Exception e) 1248catch (Exception ex) 1276catch (Exception ex) when (!ex.IsCriticalException()) 1363catch (Exception ex) when (!ex.IsCriticalException()) 2933catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
59catch (Exception ex)
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (1)
55catch (Exception ex)
System\Windows\Forms\Design\ControlDesigner.cs (6)
58private Exception? _thrownException; 419protected void DisplayError(Exception e) 1710catch (Exception e) 2227private void PaintException(PaintEventArgs e, Exception ex) 2368catch (Exception e) 2467internal void SetUnhandledException(Control? owner, Exception exception)
System\Windows\Forms\Design\ControlDesigner.DesignerWindowTarget.cs (1)
58catch (Exception ex)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
358catch (Exception e)
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
703internal static void ShowErrorDialog(IUIService? uiService, Exception ex, Control? dataGridView)
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
738catch (Exception ex) 1077catch (Exception ex) 1258catch (Exception ex) 2267catch (Exception)
System\Windows\Forms\Design\DesignerFrame.cs (1)
147catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (1)
135catch (Exception e)
System\Windows\Forms\Design\DocumentDesigner.cs (1)
1391catch (Exception e)
System\Windows\Forms\Design\LinkAreaEditor.LinkAreaUI.cs (1)
148catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\MaskDesignerDialog.cs (1)
390catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\OleDragDropHandler.cs (3)
117catch (Exception ex) when (!ex.IsCriticalException()) 209catch (Exception ex) 347catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
1435catch (Exception e) when (!e.IsCriticalException()) 1839catch (Exception e) when (!e.IsCriticalException()) 1875catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Design\SelectionUIService.cs (5)
122private void DisplayError(Exception e) 590catch (Exception e) when (!e.IsCriticalException()) 741catch (Exception e) when (!e.IsCriticalException()) 1033catch (Exception e) 1140catch (Exception e)
System\Windows\Forms\Design\SelectionUIService.HitTestInfo.cs (1)
34catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\SplitContainerDesigner.cs (1)
295catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\StandardCommandToolStripMenuItem.cs (1)
92catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\StandardMenuStripVerb.cs (2)
220catch (Exception e) 363catch (Exception e)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
629catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\TabOrder.cs (2)
823catch (Exception) 835catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (2)
90catch (Exception e) when (!e.IsCriticalException()) 116catch (Exception ex)
System\Windows\Forms\Design\ToolStripDesigner.cs (3)
539catch (Exception e) 612catch (Exception e) when (!e.IsCriticalException()) 681catch (Exception exception)
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
818catch (Exception ex)
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (5)
403catch (Exception ex) 454catch (Exception ex) 493catch (Exception ex) 535catch (Exception ex) when (!ex.IsCriticalException()) 550catch (Exception ex)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (2)
386catch (Exception e) 820catch (Exception ex) when (!ex.IsCriticalException())
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1449catch (Exception e) when (!e.IsCriticalException()) 1475catch (Exception e) when (!e.IsCriticalException())
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1453catch (Exception ex) when (!ex.IsCriticalException())
System.Windows.Forms.Design.Tests (11)
System\ComponentModel\Design\CollectionFormTests.cs (1)
873public new void DisplayError(Exception e) => base.DisplayError(e);
System\ComponentModel\Design\ComponentDesignerTests.cs (2)
1202public void ComponentDesigner_DoDefaultAction_InvokeWithNotCanceledThrowingCreateTransaction_Rethrows(Exception exception) 1485public void ComponentDesigner_DoDefaultAction_InvokeThrowsNonInvalidOperationException_CallsCommit(Exception exception)
System\ComponentModel\Design\DesignerHostTests.cs (1)
897Assert.Throws<Exception>(() => host.Container.Add(newComponent));
System\ComponentModel\Design\DesignSurfaceTests.cs (2)
452Mock<Exception> mockException = new(MockBehavior.Strict); 470Exception error = Assert.IsType<InvalidOperationException>(Assert.Single(surface.LoadErrors));
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (2)
38public void CodeDomSerializerException_Ctor_Exception_CodeLinePragma(Exception innerException, CodeLinePragma linePragma) 72public void CodeDomSerializerException_Ctor_Exception_IDesignerSerializationManager(Exception innerException, IDesignerSerializationManager manager)
System\Windows\Forms\Design\ControlDesigner.TransparentBehaviorTests.cs (1)
97Exception? exception = Record.Exception(() => _behavior.OnGiveFeedback(null, feedbackEventArgs));
System\Windows\Forms\Design\ListControlUnboundActionListTests.cs (1)
49action.Should().Throw<Exception>();
TestControlDesigner.cs (1)
49internal void DisplayErrorMethod(Exception e)
System.Windows.Forms.IntegrationTests.Common (1)
TestHelpers.cs (1)
134catch (Exception)
System.Windows.Forms.Primitives (3)
System\Windows\Forms\Internals\ThemingScope.cs (1)
116catch (Exception e) when (e is UnauthorizedAccessException or IOException)
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (2)
214catch (Exception ex) 238catch (Exception ex)
System.Windows.Forms.Primitives.Tests (3)
Interop\Oleaut32\VARIANTTests.cs (2)
5755private static void AssertToObjectThrows<T>(VARIANT variant) where T : Exception 5767private static void AssertToObjectEqualExtension<T>(object expected, VARIANT variant) where T : Exception
System\Windows\Forms\Automation\UiaTextRangeTests.cs (1)
1299Assert.ThrowsAny<Exception>(() => textRange.TestAccessor().MoveTo(start, end));
System.Windows.Forms.Primitives.TestUtilities (22)
Extensions\AssertExtensions.cs (19)
28where T : Exception 34where T : Exception 87where T : Exception 95where TException : Exception 108catch (Exception ex) when (returned) 150where TNetFxExceptionType : Exception 158Exception exception = Assert.Throws(typeof(TNetFxExceptionType), action); 172public static Exception Throws<TNetCoreExceptionType, TNetFxExceptionType>(Action action) 173where TNetCoreExceptionType : Exception 174where TNetFxExceptionType : Exception 179public static Exception Throws(Type netCoreExceptionType, Type netFxExceptionType, Action action) 216catch (Exception e) 229where TFirstExceptionType : Exception 230where TSecondExceptionType : Exception 236where TFirstExceptionType : Exception 237where TSecondExceptionType : Exception 238where TThirdExceptionType : Exception 244where T : Exception 545catch (Exception e)
PlatformDetection.Windows.cs (2)
120catch (Exception e) 183catch (Exception e) when (e is SecurityException or InvalidCastException or PlatformNotSupportedException /* UAP */)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (1)
58catch (Exception)
System.Windows.Forms.Tests (28)
System\Windows\Forms\AbstractButtonBaseTests.cs (1)
71act.Should().Throw<Exception>();
System\Windows\Forms\Application.ParkingWindowTests.cs (1)
27catch (Exception ex)
System\Windows\Forms\BinaryFormatUtilitiesTests.cs (7)
524read.Should().Throw<Exception>(); 538read.Should().Throw<Exception>(); 557read.Should().Throw<Exception>(); 819read.Should().Throw<Exception>(); 833read.Should().Throw<Exception>(); 857read.Should().Throw<Exception>(); 870read.Should().Throw<Exception>();
System\Windows\Forms\BindingCompleteEventArgsTests.cs (2)
55public void Ctor_Binding_BindingCompleteState_BindingCompleteContext_String_Exception(Binding binding, BindingCompleteState state, BindingCompleteContext context, string errorText, Exception exception) 74public void Ctor_Binding_BindingCompleteState_BindingCompleteContext_String_Exception_Bool(Binding binding, BindingCompleteState state, BindingCompleteContext context, string errorText, Exception exception, bool cancel)
System\Windows\Forms\BindingManagerDataErrorEventArgsTests.cs (1)
17public void Ctor_Exception(Exception exception)
System\Windows\Forms\BindingTests.cs (2)
382public void Binding_OnBindingComplete_ThrowsCriticalException_Rethrows(BindingCompleteEventArgs eventArgs, Exception exception) 414public void Binding_OnBindingComplete_ThrowsNonCriticalException_SetsCancelToTrue(BindingCompleteEventArgs eventArgs, Exception exception)
System\Windows\Forms\ComboBoxTests.cs (1)
442Exception exception = Record.Exception(control4.EndUpdate);
System\Windows\Forms\DataGridViewDataErrorEventArgsTests.cs (1)
18public void Ctor_Exception_Int_Int_DataGridViewDataErrorContexts(Exception exception, int columnIndex, int rowIndex, DataGridViewDataErrorContexts context)
System\Windows\Forms\ErrorProviderTests.cs (1)
1320var exception = Record.Exception(() => errorProvider.DataSource = customDataSource);
System\Windows\Forms\PictureBoxTests.cs (8)
793Assert.ThrowsAny<Exception>(() => pictureBox.ImageLocation = value); 798Assert.ThrowsAny<Exception>(() => pictureBox.ImageLocation = value); 1911Assert.ThrowsAny<Exception>(() => pictureBox.Load(value)); 1916Assert.ThrowsAny<Exception>(() => pictureBox.Load(value)); 1932Assert.ThrowsAny<Exception>(() => pictureBox.Load(value)); 1937Assert.ThrowsAny<Exception>(() => pictureBox.Load(value)); 1951Assert.ThrowsAny<Exception>(() => pictureBox.Load("Location")); 1957Assert.ThrowsAny<Exception>(() => pictureBox.Load("Location"));
System\Windows\Forms\TabControlTests.cs (1)
5724var exception = Record.Exception(() =>
System\Windows\Forms\ToolStripPanelRow.ToolStripPanelRowControlCollectionTests.cs (1)
36var exception = Record.Exception(form.Show);
System\Windows\Forms\ToolStripPanelTests.cs (1)
350var exception = Record.Exception(() => toolStripContainer.TopToolStripPanel.Controls.Add(toolStrip2));
System.Windows.Forms.TestUtilities (2)
PropertyGridInternal\SubPropertyGrid.cs (2)
45Exception? exception = null; 54catch (Exception ex)
System.Windows.Forms.UI.IntegrationTests (7)
Infra\ControlTestBase.cs (2)
319catch (Exception ex) when (DataCollectionService.LogAndPropagate(ex)) 365catch (Exception ex) when (DataCollectionService.LogAndPropagate(ex))
Infra\DataCollectionService.cs (5)
15private static readonly ConditionalWeakTable<Exception, StrongBox<bool>> s_loggedExceptions = []; 107internal static bool LogAndCatch(Exception ex) 121internal static bool LogAndPropagate(Exception ex) 135internal static bool TryLog(Exception ex) 154internal static void CaptureFailureState(string testName, Exception ex)
System.Windows.Input.Manipulations (12)
System\Windows\Input\Manipulations\Exceptions.cs (12)
21public static Exception ValueMustBeFinite(string paramName, object value) 32public static Exception ValueMustBeFiniteOrNaN(string paramName, object value) 43public static Exception ValueMustBeFiniteNonNegative(string paramName, object value) 54public static Exception IllegalPivotRadius(string paramName, object value) 65public static Exception IllegialInertiaRadius(string paramName, object value) 76public static Exception InvalidTimestamp(string paramName, long value) 87public static Exception ArgumentOutOfRange(string paramName, object value) 98public static Exception OnlyProportionalExpansionSupported( 116public static Exception InertiaParametersUnspecified2( 135public static Exception InertiaParametersUnspecified1and2( 156public static Exception CannotChangeParameterDuringInertia(string paramName) 173public static Exception NoInertiaVelocitiesSpecified(
System.Xaml (53)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (3)
20internal static bool IsCriticalException(Exception ex) 46internal static Exception Unwrap(Exception ex)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
99catch (Exception e) when (!CriticalExceptions.IsCriticalException(e))
System\Windows\Markup\ValueSerializer.cs (2)
234protected Exception GetConvertToException(object? value, Type destinationType) 254protected Exception GetConvertFromException(object? value)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (2)
1321catch (Exception ex) 2194catch (Exception ex)
System\Xaml\Parser\XamlPullParser.cs (1)
1256public XamlUnexpectedParseException(string message, Exception innerException)
System\Xaml\Runtime\ClrObjectRuntime.cs (27)
35private static Exception UnwrapTargetInvocationException(Exception e) 60catch (Exception ex) 89catch (Exception e) 167catch (Exception ex) 184catch (Exception ex) 201catch (Exception ex) 218catch (Exception ex) 235catch (Exception ex) 271catch(Exception e) 300catch(Exception e) 322catch(Exception e) 339catch(Exception e) 362catch (Exception ex) 408catch (Exception ex) 425catch (Exception ex) 450catch (Exception ex) 470catch(Exception e) 497catch(Exception e) 515catch(Exception e) 535catch(Exception e) 565catch(Exception e) 595catch (Exception e) 626catch (Exception e) 643catch (Exception ex) 704private XamlException CreateException(string message, Exception innerException) 726catch (Exception ex)
System\Xaml\XamlBackgroundReader.cs (3)
37Exception _caughtException; 108catch (Exception ex) 206Exception ex = _caughtException;
System\Xaml\XamlException.cs (9)
15public XamlException(string message, Exception innerException, int lineNumber, int linePosition) 22public XamlException(string message, Exception innerException) 108public XamlParseException(string message, Exception innerException) 130public XamlObjectWriterException(string message, Exception innerException) 156public XamlDuplicateMemberException(string message, Exception innerException) 192public XamlInternalException(string message, Exception innerException) 209public XamlSchemaException(string message, Exception innerException) 228public XamlObjectReaderException(string message, Exception innerException) 251public XamlXmlWriterException(string message, Exception innerException)
System\Xaml\XamlMember.cs (1)
107throw new ArgumentNullException(SR.GetterOrSetterRequired, (Exception)null);
System\Xaml\XamlSchemaContext.cs (4)
448catch (Exception ex) 1144catch (Exception ex) 1346catch (Exception ex) 1369catch (Exception ex)
System.Xaml.Tests (9)
System\Xaml\XamlDuplicateMemberExceptionTests.cs (1)
70public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlExceptionTests.cs (2)
44public void Ctor_String_Exception_Int_Int(string message, Exception innerException, int lineNumber, int linePosition) 62public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlInternalExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlObjectReaderExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlObjectWriterExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlParseExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlSchemaExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
System\Xaml\XamlXmlWriterExceptionTests.cs (1)
42public void Ctor_String_Exception(string message, Exception innerException, int expectedLineNumber, int expectedLinePosition)
TaskUsageLogger (2)
TaskUsageLogger.cs (2)
127catch (Exception ex) 274catch (Exception)
Templates.Blazor.Tests (30)
src\ProjectTemplates\Shared\Project.cs (1)
443catch (Exception ex)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
72var list = new List<Exception>(); 79catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
Templates.Blazor.WebAssembly.Auth.Tests (39)
src\ProjectTemplates\Shared\Project.cs (1)
443catch (Exception ex)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
72var list = new List<Exception>(); 79catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
17public BrowserAssertFailedException(IReadOnlyCollection<string> logs, Exception innerException, string screenShotPath, string innerHTML) 22private static string BuildMessage(Exception exception, IReadOnlyCollection<string> logs, string screenShotPath, string innerHTML)
src\Shared\E2ETesting\BrowserFixture.cs (2)
182Exception innerException; 206catch (Exception ex)
src\Shared\E2ETesting\BrowserTestBase.cs (1)
83catch (Exception ex)
src\Shared\E2ETesting\WaitAssert.cs (4)
93Exception lastException = null; 104catch (Exception e) 142catch (Exception ex) 159catch (Exception ex)
Templates.Blazor.WebAssembly.Tests (39)
src\ProjectTemplates\Shared\Project.cs (1)
443catch (Exception ex)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
72var list = new List<Exception>(); 79catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
17public BrowserAssertFailedException(IReadOnlyCollection<string> logs, Exception innerException, string screenShotPath, string innerHTML) 22private static string BuildMessage(Exception exception, IReadOnlyCollection<string> logs, string screenShotPath, string innerHTML)
src\Shared\E2ETesting\BrowserFixture.cs (2)
182Exception innerException; 206catch (Exception ex)
src\Shared\E2ETesting\BrowserTestBase.cs (1)
83catch (Exception ex)
src\Shared\E2ETesting\WaitAssert.cs (4)
93Exception lastException = null; 104catch (Exception e) 142catch (Exception ex) 159catch (Exception ex)
Templates.Mvc.Tests (39)
src\ProjectTemplates\Shared\Project.cs (1)
443catch (Exception ex)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
72var list = new List<Exception>(); 79catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
17public BrowserAssertFailedException(IReadOnlyCollection<string> logs, Exception innerException, string screenShotPath, string innerHTML) 22private static string BuildMessage(Exception exception, IReadOnlyCollection<string> logs, string screenShotPath, string innerHTML)
src\Shared\E2ETesting\BrowserFixture.cs (2)
182Exception innerException; 206catch (Exception ex)
src\Shared\E2ETesting\BrowserTestBase.cs (1)
83catch (Exception ex)
src\Shared\E2ETesting\WaitAssert.cs (4)
93Exception lastException = null; 104catch (Exception e) 142catch (Exception ex) 159catch (Exception ex)
Templates.Tests (39)
src\ProjectTemplates\Shared\Project.cs (1)
443catch (Exception ex)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
72var list = new List<Exception>(); 79catch (Exception e)
src\Shared\CertificateGeneration\CertificateManager.cs (13)
135catch (Exception e) 235catch (Exception e) 274catch (Exception e) 289catch (Exception e) 307catch (Exception e) 337catch (Exception e) 426catch (Exception e) 451catch (Exception e) 583catch (Exception e) when (Log.IsEnabled()) 606catch (Exception ex) when (Log.IsEnabled()) 634catch (Exception ex) when (Log.IsEnabled()) 724catch (Exception ex) when (Log.IsEnabled()) 826catch (Exception ex) when (Log.IsEnabled())
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
144catch (Exception ex) 325catch (Exception ex) 448catch (Exception) 469catch (Exception ex)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (10)
206catch (Exception ex) 372catch (Exception ex) 575catch (Exception ex) 604catch (Exception ex) 634catch (Exception ex) 654catch (Exception ex) 680catch (Exception ex) 816catch (Exception ex) 853catch (Exception ex) 928catch (Exception ex)
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
17public BrowserAssertFailedException(IReadOnlyCollection<string> logs, Exception innerException, string screenShotPath, string innerHTML) 22private static string BuildMessage(Exception exception, IReadOnlyCollection<string> logs, string screenShotPath, string innerHTML)
src\Shared\E2ETesting\BrowserFixture.cs (2)
182Exception innerException; 206catch (Exception ex)
src\Shared\E2ETesting\BrowserTestBase.cs (1)
83catch (Exception ex)
src\Shared\E2ETesting\WaitAssert.cs (4)
93Exception lastException = null; 104catch (Exception e) 142catch (Exception ex) 159catch (Exception ex)
TestDiscoveryWorker (1)
Program.cs (1)
106catch (Exception ex)
TestProject.IntegrationServiceA (4)
Postgres\NpgsqlEFCoreExtensions.cs (1)
20catch (Exception e)
Postgres\PostgresExtensions.cs (1)
25catch (Exception e)
Redis\RedisExtensions.cs (1)
26catch (Exception e)
ResilienceUtils.cs (1)
11public static ResiliencePipelineBuilder GetDefaultResiliencePipelineBuilder<TException>(Func<OnRetryArguments<object>, ValueTask> onRetry, int overallTimeoutSecs = 90) where TException : Exception
UIAutomationClient (14)
MS\Internal\Automation\Accessible.cs (3)
44catch (Exception e) 67catch( Exception e ) 96private bool IsCriticalMSAAException(Exception e)
MS\Internal\Automation\FocusTracker.cs (2)
190catch( Exception e ) 259catch( Exception e )
MS\Internal\Automation\InvokeHandlers.cs (1)
97catch (Exception e)
MS\Internal\Automation\Misc.cs (1)
210internal static bool IsCriticalException( Exception e )
MS\Internal\Automation\ProxyManager.cs (1)
699catch( Exception e )
MS\Internal\Automation\QueueProcessor.cs (1)
164catch (Exception e)
MS\Internal\Automation\UiaCoreApi.cs (2)
1128&& !(arr[1] is Exception) ) 1594catch (Exception)
MS\Internal\Automation\WinEventWrap.cs (2)
188catch( Exception e ) 203catch( Exception ex )
System\Windows\Automation\AutomationElement.cs (1)
585catch (Exception e)
UIAutomationClientSideProviders (35)
MS\Internal\AutomationProxies\Accessible.cs (23)
390catch (Exception e) 486catch (Exception e) 510catch (Exception e) 527catch (Exception e) 583catch (Exception e) 602catch (Exception e) 649catch (Exception e) 710catch (Exception e) 736catch (Exception e) 790catch (Exception e) 847catch (Exception e) 886catch (Exception e) 924catch (Exception e) 1089catch (Exception e) 1124catch (Exception e) 1154catch (Exception e) 1184catch (Exception e) 1200catch (Exception e) 1216catch (Exception e) 1232catch (Exception e) 1249catch (Exception e) 1267catch (Exception e) 1288private static bool HandleIAccessibleException(Exception e)
MS\Internal\AutomationProxies\Misc.cs (2)
802internal static bool IsCriticalException(Exception e) 1822catch (Exception ex)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (1)
1204catch (Exception e)
MS\Internal\AutomationProxies\MSAAWinEventWrap.cs (2)
137catch (Exception e) 154catch (Exception e)
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
132catch( Exception e )
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (1)
96catch (Exception e)
MS\Internal\AutomationProxies\WinEventTracker.cs (5)
163catch (Exception e) 262catch (Exception e) 307catch (Exception e) 325catch (Exception e) 478catch (Exception e)
UIAutomationTypes (5)
System\Windows\Automation\ElementNotAvailableException.cs (2)
47public ElementNotAvailableException(string message, Exception innerException) : base(message, innerException) 56public ElementNotAvailableException(Exception innerException) : base(SR.ElementNotAvailable, innerException)
System\Windows\Automation\ElementNotEnabledException.cs (1)
47public ElementNotEnabledException(string message, Exception innerException) : base(message, innerException)
System\Windows\Automation\NoClickablePointException.cs (1)
39public NoClickablePointException(string message, Exception innerException) : base(message, innerException) {}
System\Windows\Automation\ProxyAssemblyNotLoadedException.cs (1)
44public ProxyAssemblyNotLoadedException(string message, Exception innerException) : base(message, innerException) {}
UnitTests.Common (3)
TestHelpers.cs (2)
104catch (Exception ex) 211catch (Exception ex)
TestTypes.cs (1)
120public void Exception(System.Exception ex)
vbc (17)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (4)
57internal static void LogException(this ICompilerServerLogger logger, Exception exception, string reason) 69Exception? e = exception.InnerException; 80void AppendException(Exception exception) 136catch (Exception e)
src\Compilers\Shared\BuildClient.cs (2)
181catch (Exception ex) 245catch (Exception ex)
src\Compilers\Shared\BuildServerConnection.cs (11)
129catch (Exception) 141catch (Exception) 289catch (Exception e) 314catch (Exception e) 358catch (Exception e) 402catch (Exception e) when (e is IOException || e is TimeoutException) 428catch (Exception e) when (!(e is TaskCanceledException || e is OperationCanceledException)) 727catch (Exception) 774catch (Exception) 806catch (Exception) 825catch (Exception)
VBCSCompiler (33)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (4)
57internal static void LogException(this ICompilerServerLogger logger, Exception exception, string reason) 69Exception? e = exception.InnerException; 80void AppendException(Exception exception) 136catch (Exception e)
src\Compilers\Server\VBCSCompiler\AnalyzerConsistencyChecker.cs (1)
62catch (Exception e)
src\Compilers\Server\VBCSCompiler\BuildServerController.cs (1)
82catch (Exception e)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (2)
43catch (Exception ex) 137catch (Exception ex)
src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (1)
160catch (Exception ex)
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
102catch (Exception)
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnection.cs (2)
45catch (Exception ex) 76catch (Exception ex)
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (5)
23internal Exception? Exception { get; } 25internal ListenResult(NamedPipeClientConnection? connection = null, Exception? exception = null) 104catch (Exception ex) 113catch (Exception ex) 217catch (Exception ex)
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (1)
121catch (Exception ex)
src\Compilers\Server\VBCSCompiler\VBCSCompiler.cs (2)
32catch (Exception ex) 46catch (Exception e)
src\Compilers\Shared\BuildClient.cs (2)
181catch (Exception ex) 245catch (Exception ex)
src\Compilers\Shared\BuildServerConnection.cs (11)
129catch (Exception) 141catch (Exception) 289catch (Exception e) 314catch (Exception e) 358catch (Exception e) 402catch (Exception e) when (e is IOException || e is TimeoutException) 428catch (Exception e) when (!(e is TaskCanceledException || e is OperationCanceledException)) 727catch (Exception) 774catch (Exception) 806catch (Exception) 825catch (Exception)
VisualBasicRuntimeTest (1)
Program.cs (1)
59catch (Exception)
Wasm.Performance.ConsoleHost (1)
ConsoleHostRenderer.cs (1)
22protected override void HandleException(Exception exception)
Wasm.Performance.Driver (1)
Program.cs (1)
307catch (Exception ex)
WindowsBase.Tests (17)
Helpers.cs (4)
25catch (Exception e) 50catch (Exception e) 91catch (Exception) 112catch (Exception)
System\Security\RightsManagement\RightsManagementExceptionTests.cs (5)
76public void Ctor_RightsManagementFailureCode_Exception(RightsManagementFailureCode failureCode, Exception innerException) 127public void Ctor_String_Exception(string message, Exception innerException) 148public void Ctor_String_Exception_Null(Exception innerException) 172public void Ctor_RightsManagementFailureCode_String_Exception(RightsManagementFailureCode failureCode, string message, Exception innerException) 196public void Ctor_RightsManagementFailureCode_String_Exception_Null(RightsManagementFailureCode failureCode, Exception innerException)
System\Windows\Data\DataSourceProviderTests.cs (8)
1456var error = new Exception(); 1534var error = new Exception(); 1664var error1 = new Exception(); 1667var error2 = new Exception(); 1887public new void OnQueryFinished(object newData, Exception error, DispatcherOperationCallback completionWork, object callbackArguments) => base.OnQueryFinished(newData, error, completionWork, callbackArguments); 1921public Action<object, Exception, DispatcherOperationCallback, object>? OnQueryFinishedAction { get; set; } 1923protected override void OnQueryFinished(object newData, Exception error, DispatcherOperationCallback completionWork, object callbackArguments) 1964public new void OnQueryFinished(object newData, Exception error, DispatcherOperationCallback completionWork, object callbackArguments) => base.OnQueryFinished(newData, error, completionWork, callbackArguments);
WindowsFormsIntegration (6)
System\Windows\Integration\IntegrationExceptionEventArgs.cs (3)
17public IntegrationExceptionEventArgs(bool throwException, Exception exception) 28private Exception _exception; 48public Exception Exception
System\Windows\Integration\LayoutExceptionEventArgs.cs (1)
16public LayoutExceptionEventArgs(Exception exception)
System\Windows\Integration\PropertyMap.cs (1)
312catch (Exception ex)
System\Windows\Integration\PropertyMappingExceptionEventArgs.cs (1)
20public PropertyMappingExceptionEventArgs(Exception exception, string propertyName, object propertyValue)
WinFormsControlsTest (3)
PictureBoxes.cs (1)
37catch (Exception ex)
Program.cs (1)
24catch (Exception)
RichTextBoxes.cs (1)
103catch (Exception ex)
XmlFileLogger (1)
XmlFileLogger.cs (1)
82catch (Exception e)
xunit.assert (70)
CollectionAsserts.cs (8)
73 var errors = new List<Tuple<int, string, Exception>>(); 82 catch (Exception ex) 84 errors.Add(new Tuple<int, string, Exception>(idx, ArgumentFormatter.Format(item), ex)); 127 var errors = new List<Tuple<int, string, Exception>>(); 136 catch (Exception ex) 138 errors.Add(new Tuple<int, string, Exception>(idx, ArgumentFormatter.Format(item), ex)); 174 catch (Exception ex) 215 catch (Exception ex)
EqualityAsserts.cs (10)
153 var exception = default(Exception); 169 catch (Exception ex) 217 catch (Exception ex) 257 catch (Exception ex) 668 var exception = default(Exception); 684 catch (Exception ex) 743 catch (Exception ex) 771 catch (Exception ex)
ExceptionAsserts.cs (16)
31 static Exception Throws( 34 Exception? exception) 56 public static Exception Throws( 68 public static Exception Throws( 80 public static Exception Throws( 94 where T : Exception => 111 where T : Exception => 120 where T : Exception 189 static Exception ThrowsAny( 192 Exception? exception) 215 where T : Exception => 230 where T : Exception => 237 where T : Exception 249 where T : Exception => 258 public static async Task<Exception> ThrowsAsync( 270 where T : Exception =>
MultipleAsserts.cs (2)
33 var exceptions = new List<Exception>(); 40 catch (Exception ex)
Record.cs (7)
37 protected static Exception? RecordException(Action testCode) 49 catch (Exception ex) 64 protected static Exception? RecordException( 80 catch (Exception ex) 94 protected static Exception RecordException(Func<Task> testCode) 105 protected static async Task<Exception?> RecordExceptionAsync(Func<Task> testCode) 117 catch (Exception ex)
Sdk\ArgumentFormatter.cs (4)
289 catch (Exception ex) 683 internal static Exception? UnwrapException(Exception? ex) 713 catch (Exception ex)
Sdk\AssertHelper.cs (2)
518 catch (Exception ex) 532 catch (Exception ex)
Sdk\Exceptions\AllException.cs (1)
42 IReadOnlyList<Tuple<int, string, Exception>> errors)
Sdk\Exceptions\CollectionException.cs (2)
42 static string FormatInnerException(Exception innerException) 71 Exception exception,
Sdk\Exceptions\EqualException.cs (3)
36 Exception? innerException = null) : 101 Exception? error, 209 Exception? error = null,
Sdk\Exceptions\EquivalentException.cs (2)
34 Exception? innerException = null) : 153 Exception? innerException = null) =>
Sdk\Exceptions\MultipleException.cs (3)
28 MultipleException(IEnumerable<Exception> innerExceptions) : 39 public IReadOnlyCollection<Exception> InnerExceptions { get; } 54 public static MultipleException ForFailures(IReadOnlyCollection<Exception> innerExceptions) =>
Sdk\Exceptions\NotEqualException.cs (3)
33 Exception? innerException = null) : 78 Exception? error = null, 143 Exception? error = null,
Sdk\Exceptions\NotNullException.cs (1)
34 public static Exception ForNullStruct(Type type) =>
Sdk\Exceptions\NullException.cs (1)
39 public static Exception ForNonNullStruct<[DynamicallyAccessedMembers(
Sdk\Exceptions\ThrowsAnyException.cs (2)
31 Exception? innerException = null) : 46 Exception actual) =>
Sdk\Exceptions\ThrowsException.cs (2)
31 Exception? innerException = null) : 46 Exception actual) =>
Sdk\Exceptions\XunitException.cs (1)
51 Exception? innerException) :
xunit.console (5)
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\Native\NativeMethods.Darwin.cs (1)
38catch (Exception ex)
common\Json.cs (1)
551public JsonDeserializerException(string message, Exception innerException, int line, int column)
ConsoleRunner.cs (3)
103catch (Exception ex) 414catch (Exception ex) 418var e = ex;