WinJS.Promise.wrapError function

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 WinJS version

WinJS 1.0

Namespace

WinJS.Promise

See also

Promise