onerror event

Applies to Windows and Windows Phone

Occurs when an unhandled error has been raised.

Syntax


WinJS.Application.addEventListener("error", listenerName);
or
WinJS.Application.onerror = listenerName;

Event handler parameters

eventInfo

Type: CustomEvent

An object that contains information about the event.

Remarks

The WinJS.Application.onerror catches all of the errors that would otherwise be caught by window.onerror. It also catches errors defined within the Windows Library for JavaScript, including Promise objects that have timed out or failed. It is recommended that you use WinJS.Application.onerror for top-level error handling in your app.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Application

Library

Base.js

 

 

Show:
© 2014 Microsoft