ErrObject.GetException Metódus

Definíció

A hibát jelző kivételt adja vissza.

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

Válaszok

A hiba előfordulását jelző kivétel.

Példák

Az alábbi kód az objektum kivételéhez Err rendelt üzenetet jeleníti meg:

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)

Megjegyzések

A GetException függvény csak az Err objektumosztályból érhető el. Az objektum tulajdonságával ExceptionErr együttműködve megjeleníti a bekövetkezett hibát.

A következőre érvényes:

Lásd még