WinJS.Promise.wrapError function

Applies to Windows and Windows Phone

Wraps a non-promise error value in a promise. You can use this function if you need to pass an error to a function that requires a promise.

Syntax


var promise = WinJS.Promise.wrapError(error);

Parameters

error

Type:

A non-promise error value to be wrapped in a promise.

Return value

Type: Promise

A promise that is in an error state with the specified value.

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.Promise

Library

Base.js

See also

Promise

 

 

Show:
© 2014 Microsoft