[jira] [Commented] (CB-5782) Catch exceptions and print nice error when cordova-cli run from a non cordova project.
[ https://issues.apache.org/jira/browse/CB-5782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945562#comment-13945562 ] Josh Soref commented on CB-5782: 1. I think that I want --verbose to include the stack CordovaError or not a CordovaError. Or possibly a --debug flag if people don't want --verbose for that purpose... 2. The change that reintroduced stacks has made downstream consumers less happy, so I'd like a --nostack flag (which our GUI will pass to cordova). 3. Is there a bug, plan, or schema for deciding which things should be CordovaErrors and which shouldn't be? I posted a PR for the CLI side of 3 -- but that still leaves plugman at least. > Catch exceptions and print nice error when cordova-cli run from a non cordova > project. > -- > > Key: CB-5782 > URL: https://issues.apache.org/jira/browse/CB-5782 > Project: Apache Cordova > Issue Type: Bug > Components: CLI >Reporter: Michal Mocny >Assignee: Mark Koudritsky >Priority: Minor > > cordova prepare prints scary stack trace when run from the wrong directory. > This is likely a common error and we should make it clear what is happening. > Seems we are already catching the case, just failing to report it gracefully: > throw new Error('Current working directory is not a Cordova-based -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5782) Catch exceptions and print nice error when cordova-cli run from a non cordova project.
[ https://issues.apache.org/jira/browse/CB-5782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13880318#comment-13880318 ] ASF subversion and git services commented on CB-5782: - Commit 2676ff88a8b547d9542bc51e9e0b18bd6966ef4d in branch refs/heads/master from [~kamrik] [ https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;h=2676ff8 ] CB-5782 Use CordovaError wherever relevant. Other than the trivial changes that look like new Error(...) -> new CordovaError(...) there is also a change in util.js to throw the error instead of returning it and associated changes in specs. > Catch exceptions and print nice error when cordova-cli run from a non cordova > project. > -- > > Key: CB-5782 > URL: https://issues.apache.org/jira/browse/CB-5782 > Project: Apache Cordova > Issue Type: Bug > Components: CLI >Reporter: Michal Mocny >Assignee: Mark Koudritsky >Priority: Minor > > cordova prepare prints scary stack trace when run from the wrong directory. > This is likely a common error and we should make it clear what is happening. > Seems we are already catching the case, just failing to report it gracefully: > throw new Error('Current working directory is not a Cordova-based -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-5782) Catch exceptions and print nice error when cordova-cli run from a non cordova project.
[ https://issues.apache.org/jira/browse/CB-5782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13877829#comment-13877829 ] ASF subversion and git services commented on CB-5782: - Commit 8aecd49667638b50a14709a8fa1021d0724675db in branch refs/heads/master from [~kamrik] [ https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;h=8aecd49 ] CB-5782 Add a derived exception class for better error reporting in CLI The on('uncaughtException') handler was removed recently in cordova-cli because it was hiding the stack traces of some legit exceptions, but this results in scary traces for simple errors like running outside a corodva project. This change reintroduces the on('uncaughtException') handler and adds a special CordovaError class for such simple errors. For exceptions of CordovaError class only the message will be printed, for all other errors - the full stack trace. Another pass over the code will be needed to find and convert the Errors to CordovaErrors where appropriate. Will be done in a separate change. > Catch exceptions and print nice error when cordova-cli run from a non cordova > project. > -- > > Key: CB-5782 > URL: https://issues.apache.org/jira/browse/CB-5782 > Project: Apache Cordova > Issue Type: Bug > Components: CLI >Reporter: Michal Mocny >Assignee: Mark Koudritsky >Priority: Minor > > cordova prepare prints scary stack trace when run from the wrong directory. > This is likely a common error and we should make it clear what is happening. > Seems we are already catching the case, just failing to report it gracefully: > throw new Error('Current working directory is not a Cordova-based -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (CB-5782) Catch exceptions and print nice error when cordova-cli run from a non cordova project.
[ https://issues.apache.org/jira/browse/CB-5782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13869676#comment-13869676 ] Mark Koudritsky commented on CB-5782: - It seems to print the stack when any exception is thrown. "cordova foo" and "cordova platform add foo" run in a cordova project dir also print the scary call stack. Will look into this. > Catch exceptions and print nice error when cordova-cli run from a non cordova > project. > -- > > Key: CB-5782 > URL: https://issues.apache.org/jira/browse/CB-5782 > Project: Apache Cordova > Issue Type: Bug > Components: CLI >Reporter: Michal Mocny >Assignee: Mark Koudritsky >Priority: Minor > > cordova prepare prints scary stack trace when run from the wrong directory. > This is likely a common error and we should make it clear what is happening. > Seems we are already catching the case, just failing to report it gracefully: > throw new Error('Current working directory is not a Cordova-based -- This message was sent by Atlassian JIRA (v6.1.5#6160)