You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Lorin Beer (JIRA)" <ji...@apache.org> on 2013/12/05 01:28:35 UTC

[jira] [Created] (CB-5572) exceptions occurring in the cli are not bubbled to the catch of the promise (in project consuming the CLI as a library)

Lorin Beer created CB-5572:
------------------------------

             Summary: exceptions occurring in the cli are not bubbled to the catch of the promise (in project consuming the CLI as a library)
                 Key: CB-5572
                 URL: https://issues.apache.org/jira/browse/CB-5572
             Project: Apache Cordova
          Issue Type: Bug
          Components: CLI
            Reporter: Lorin Beer


the promise library used by the Cordova CLI (https://npmjs.org/package/q) has a spec which includes a catch function.

useable like this:
Q.func(promisedstep1)
.then(promisedstep2)
...
.catch(function(error){
...
});

use of this syntax 

steps to replicate:

execute

    cordova.raw.platform.supports('.', "<platform>").then(function(){
        ...
    }).catch(function (e) {
        console.log(e);
    });

in a project which requires cordova, but on a system where <platform> sdk is not present or inaccessible to the cli.

the result is that any errors in the Cordova CLI are not caught by the promised catch, but instead cause the process consuming the cli to error out.



--
This message was sent by Atlassian JIRA
(v6.1#6144)