Click or drag to resize

ExceptionExtensionsFind Method (Exception, Type)

Searches an exception for an underlying exception of a specific type. This is useful for checking whether an exception has a specific inner exception or whether an AggregateException was triggered with a specific exception type.

Namespace:  System
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.14.0
Syntax
public static Exception Find(
	this Exception e,
	Type exceptionType
)

Parameters

e
Type: SystemException
The exception being tested.
exceptionType
Type: SystemType
The target exception type.

Return Value

Type: Exception
The underlying exception or null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Exception. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also