Hi,
I have an app that makes an ajax request to an endpoint that might not exist. If the endpoint does not exist, then a dialog appears with the following message:
Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html)
Once I hit the OK button the app is shutdown.
I noticed the following logs in the ddms:
CordovaWebView: TIMEOUT ERROR!
Cordova: CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html
DroidGap: onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/android_asset\/www\/index.html","description":"The connection to the server was unsuccessful."})
I have read many posts about this error, but most people are happy just adjusting the timeout of their ajax call. This is not an option for me because it is not a timeout issue. It is perfectly normal for the endpoint to not exist in some cases in my app. I want my app to handle the fact that the endpoint did not exist rather than the framework handling it and shutting down my app. I want to simply handle it in the failure function of the ajax call. The failure function does get called, but there does not seem to be anyway of preventing the app from being shutdown.
Any help on this issue would be greatly appreciated.
Sincerely,
dustfinger.
I have an app that makes an ajax request to an endpoint that might not exist. If the endpoint does not exist, then a dialog appears with the following message:
Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html)
Once I hit the OK button the app is shutdown.
I noticed the following logs in the ddms:
CordovaWebView: TIMEOUT ERROR!
Cordova: CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html
DroidGap: onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/android_asset\/www\/index.html","description":"The connection to the server was unsuccessful."})
I have read many posts about this error, but most people are happy just adjusting the timeout of their ajax call. This is not an option for me because it is not a timeout issue. It is perfectly normal for the endpoint to not exist in some cases in my app. I want my app to handle the fact that the endpoint did not exist rather than the framework handling it and shutting down my app. I want to simply handle it in the failure function of the ajax call. The failure function does get called, but there does not seem to be anyway of preventing the app from being shutdown.
Any help on this issue would be greatly appreciated.
Sincerely,
dustfinger.

