Share via


CoreApplication.UnhandledErrorDetected 이벤트

정의

전역 오류 처리 논리의 일부로 CoreApplication instance 라우팅되는 기본 오류가 있을 때 발생합니다.

// Register
static event_token UnhandledErrorDetected(EventHandler<UnhandledErrorDetectedEventArgs> const& handler) const;

// Revoke with event_token
static void UnhandledErrorDetected(event_token const* cookie) const;

// Revoke with event_revoker
static CoreApplication::UnhandledErrorDetected_revoker UnhandledErrorDetected(auto_revoke_t, EventHandler<UnhandledErrorDetectedEventArgs> const& handler) const;
public static event System.EventHandler<UnhandledErrorDetectedEventArgs> UnhandledErrorDetected;
function onUnhandledErrorDetected(eventArgs) { /* Your code */ }
Windows.ApplicationModel.Core.CoreApplication.addEventListener("unhandlederrordetected", onUnhandledErrorDetected);
Windows.ApplicationModel.Core.CoreApplication.removeEventListener("unhandlederrordetected", onUnhandledErrorDetected);
- or -
Windows.ApplicationModel.Core.CoreApplication.onunhandlederrordetected = onUnhandledErrorDetected;
Public Shared Custom Event UnhandledErrorDetected As EventHandler(Of UnhandledErrorDetectedEventArgs) 

이벤트 유형

설명

앱의 수명 주기 관리 코드의 일부로 개발자는 UnhandledErrorDetected 이벤트에서 오류 데이터(UnhandledError)를 검사하고 오류를 처리된 것으로 표시할지 여부를 선택할 수 있습니다. 오류가 이벤트 데이터에서 처리된 것으로 표시되면 실행을 계속할 수 있습니다. 오류가 처리된 것으로 표시되지 않으면 앱과 해당 프로세스가 종료됩니다.

UnhandledErrorDetected를 실행할 수 있는 오류에는 비동기 완료 처리기 내에서 코드에서 throw되는 오류가 포함됩니다.

UnhandledErrorDetected 는 앱 코드 이벤트 처리기가 오류를 throw하는 경우 발생하지만 처리기가 실행된 이유는 시스템 코드(앱 코드 아님)가 이벤트를 발생시켰기 때문입니다. 앱 코드에서 해당 오류가 항상 표시되거나 처리기가 실행된 것을 볼 수는 없습니다.

대리자에서 오류를 반환하면 오류의 처리된 상태가 지워지게 됩니다.

적용 대상