TaskFailureDetails.IsCausedBy<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns true
if the task failure was provided by the specified exception type.
public bool IsCausedBy<T> () where T : Exception;
member this.IsCausedBy : unit -> bool (requires 'T :> Exception)
Public Function IsCausedBy(Of T As Exception) () As Boolean
Type Parameters
- T
The type of exception to test against.
Returns
Returns true
if the ErrorType value matches T
; false
otherwise.
Remarks
This method allows checking if a task failed due to an exception of a specific type by attempting to load the type specified in ErrorType. If the exception type cannot be loaded for any reason, this method will return false
. Base types are supported.