AmpEBK created CB-7830:
--------------------------

             Summary: No more possible to catch a TIMEOUT ERROR with Cordova 
Android 3.6.3
                 Key: CB-7830
                 URL: https://issues.apache.org/jira/browse/CB-7830
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 3.6.3
         Environment: OS : Android 4.0.4
Software : cordova android 3.6.3
            Reporter: AmpEBK


Dear All,

After migrating from Cordova 3.4.0 to 3.6.3, it seems now to be impossible to 
catch the TIMEOUT ERROR in my activity (when my web site does not respond for 
instance). In the 3.5 release notes, a new behavior has been added "Ignore 
multiple onPageFinished() callbacks & onReceivedError due to stopLoading()" and 
seems to be the cause.
Looking at closely to the source code of the CordovaWebView java class and 
calling the loadUrlIntoView method, if we meet the 'Timeout error method' we 
have:
            public void run() {
                me.stopLoading();
                LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");
                if (viewClient != null) {
                    viewClient.onReceivedError(me, -6, "The connection to the 
server was unsuccessful.", url);
                }
            }
but the line 'me.stopLoading();' does : viewClient.isCurrentlyLoading = false;
and when we call the line 'viewClient.onReceivedError(me, -6, "The connection 
to the server was unsuccessful.", url);', we call the onReceivedError method of 
the CordovaWebViewClient java class,
which ignores the error due to stopLoading():
        if (!isCurrentlyLoading) {
            return;
        }
Thus, this method returns and the super.onReceivedError() is never called.
Please help
Best regards,
Amp



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to