Share via


ErrObject.GetException Méthode

Définition

Retourne l'exception représentant l'erreur survenue.

public:
 Exception ^ GetException();
public Exception? GetException ();
public Exception GetException ();
member this.GetException : unit -> Exception
Public Function GetException () As Exception

Retours

L’exception représentant l’erreur survenue.

Exemples

Le code suivant affiche le message affecté à l’exception dans l’objet Err :

On Error Resume Next
Dim myError As System.Exception
' Generate an overflow exception.
Err.Raise(6)
' Assigns the exception from the Err object to myError.
myError = Err.GetException()
' Displays the message associated with the exception.
MsgBox(myError.Message)

Remarques

La GetException fonction est disponible uniquement à partir de la classe d’objet Err . Il fonctionne avec la Exception propriété de l’objet Err pour afficher l’erreur qui s’est produite.

S’applique à

Voir aussi