ErrObject.GetException Metodo

Definizione

Restituisce l'eccezione che rappresenta l'errore.

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

Restituisce

Eccezione che rappresenta l'errore che si è verificato.

Esempio

Nel codice seguente viene visualizzato il messaggio assegnato all'eccezione nell'oggetto 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)

Commenti

La GetException funzione è disponibile solo dalla Err classe oggetto. Funziona con la Exception proprietà dell'oggetto Err per visualizzare l'errore che si è verificato.

Si applica a

Vedi anche