Share via


ErrObject.GetException Yöntem

Tanım

Oluşan hatayı temsil eden özel durumu döndürür.

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

Döndürülenler

Oluşan hatayı temsil eden özel durum.

Örnekler

Aşağıdaki kod, nesnesindeki Err özel duruma atanan iletiyi görüntüler:

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)

Açıklamalar

GetException işlevi yalnızca nesne sınıfından Err kullanılabilir. Oluşan hatayı görüntülemek için nesnesinin özelliğiyle ExceptionErr çalışır.

Şunlara uygulanır

Ayrıca bkz.