cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Koudritsky" <kam...@gmail.com>
Subject Re: Review Request 17064: Add a CordovaError exception class for better error reporting in CLI
Date Mon, 20 Jan 2014 19:20:05 GMT


> On Jan. 20, 2014, 1:53 a.m., Andrew Grieve wrote:
> > src/util.js, line 221
> > <https://reviews.apache.org/r/17064/diff/1/?file=427259#file427259line221>
> >
> >     No need to do this within the function. You should do it after defining the
function:
> >     CordovaError.prototype.__proto__ = ...

The argument the guy from the stack overflow link gives for assigning the prototype inside
the constructor, is that this way you can put the definition wherever you want. If prototype
assignment is done outside the func, you must be careful to put it before any other code in
the same file wants to throw that error. The case seems relatively rare, but would probably
lead to a pretty obscure bug. Not sure how strong this argument is.


- Mark


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17064/#review32272
-----------------------------------------------------------


On Jan. 17, 2014, 7:36 p.m., Mark Koudritsky wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/17064/
> -----------------------------------------------------------
> 
> (Updated Jan. 17, 2014, 7:36 p.m.)
> 
> 
> Review request for cordova.
> 
> 
> Bugs: CB-5782
>     https://issues.apache.org/jira/browse/CB-5782
> 
> 
> Repository: cordova-cli
> 
> 
> Description
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   src/cli.js d22ba56 
>   src/util.js 278172a 
> 
> Diff: https://reviews.apache.org/r/17064/diff/
> 
> 
> Testing
> -------
> 
> npm test
> cordova plugin ls (inside and outside a a proj)
> cordova bad_command
> 
> 
> Thanks,
> 
> Mark Koudritsky
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message