[ 
https://issues.apache.org/jira/browse/CB-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403229#comment-13403229
 ] 

Patrick Mueller commented on CB-964:
------------------------------------

re-throwing the exception means "do whatever the platform does with uncaught 
exceptions", since we may be (prolly will be) on the bottom of the stack for 
callbacks.

Which really isn't good enough.  I *would* like us to re-throw the exception, 
but I think I could see us emitting an "error" event as well, somewhere.  
Probably not document or window.  Unless it was "cordovaError" or something, 
but still, probably not on document/window.

The error event should have some context in it, so folks can tell where it came 
from.  ie, what "API" is this a callback for?  We won't get that info easily 
from a native error handler, and it's really useful to have.  Some platforms 
(recent Android maybe) will have a stack property on their error which will be 
useful to provide in the event as well.  Guess we could just add the exception 
itself to the event.  Not sure that the existing onerror handlers do that 
either, btw, so ... this is sounding better to me all the time!

Of course, the stack should be clean at that point - we should not have a case 
where someone can re-try an API or anything (until we have a Smalltalk version, 
anyway).  This is an informational event.
                
> Error in success callback should generate event
> -----------------------------------------------
>
>                 Key: CB-964
>                 URL: https://issues.apache.org/jira/browse/CB-964
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.9.0
>            Reporter: Kamen Kanchev
>            Assignee: Filip Maj
>
> Error in success callback should generate a document event. This is important 
> when loading, since for example an error occurs while deviceready. There is a 
> try-catch statement in the CordovaJS, hence window.onerror() is not detecting 
> the error.
> For example, Sencha Touch 2 fails to load because of localstorage corruption 
> while loading, an the app crashes. A possible fix in this case is to clear 
> the local storage and to window.location.reload();
> it is very east to fix this one - just add:
> fireDocumentEvent("CDVSuccessCallbackError");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to