ErrObject.GetException 메서드

정의

발생한 오류를 나타내는 예외를 반환합니다.

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

반환

발생한 오류를 나타내는 예외입니다.

예제

다음 코드는 예외에 할당 된 메시지를 표시 합니다 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)

설명

GetException 함수를 에서만 사용할 수는 Err 개체 클래스입니다. 와 함께 작동 합니다 Exception 의 속성은 Err 발생 한 오류를 표시 하도록 개체입니다.

적용 대상

추가 정보