Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WinRTError Object (JavaScript)

When a Windows Runtime call returns an HRESULT that indicates a failure, JavaScript converts it to a special Windows Runtime error. It is available only in Windows 8.x Store apps, when the Windows Runtime is available, as part of the global JavaScript namespace.

errorObj = new WinRTError();

The WinRTError error type is used only for errors that originate in Windows Runtime APIs.

The following example shows how a WinRTError is thrown and caught.

try {
            Windows.Storage.ApplicationData.localFolder.createFileAsync("sample.txt");
        } catch (err) {
            var n = err;
        }

The WinRTError object has no methods.

The WinRTError object has the same properties as the Error Object (JavaScript) object.

The WinRTError object is supported only in Windows 8.x Store apps, not in Internet Explorer.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft