Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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 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.KnownFolders.documentsLibrary.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 Store apps, not in Internet Explorer.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.