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.

Syntax


errorObj = new WinRTError();  

Remarks

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

Example

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

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

Methods

The WinRTError object has no methods.

Properties

The WinRTError object has the same properties as the Error Object object.

Requirements

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

See Also

Error Object