ExceptionDispatchInfo.Capture(Exception) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée un ExceptionDispatchInfo objet qui représente l’exception spécifiée au point actuel dans le code.
public:
static System::Runtime::ExceptionServices::ExceptionDispatchInfo ^ Capture(Exception ^ source);
public static System.Runtime.ExceptionServices.ExceptionDispatchInfo Capture(Exception source);
static member Capture : Exception -> System.Runtime.ExceptionServices.ExceptionDispatchInfo
Public Shared Function Capture (source As Exception) As ExceptionDispatchInfo
Paramètres
- source
- Exception
Exception dont l’état est capturé et représenté par l’objet retourné.
Retours
Objet qui représente l’exception spécifiée au point actuel dans le code.
Exceptions
source a la valeur null.
Remarques
Vous pouvez utiliser l’objet ExceptionDispatchInfo retourné par cette méthode à un autre moment et éventuellement sur un autre thread pour réactiver l’exception spécifiée, comme si l’exception avait coulé du point où elle a été capturée jusqu’au point où elle est rethrown.
Si l’exception est active lorsqu’elle est capturée, les informations de trace de pile actuelles et les informations Watson contenues dans l’exception sont stockées. S’il est inactif, autrement dit, s’il n’a pas été levée, il n’a pas de trace de pile ni d’informations Watson.