When our app is started up within a secured Wifi and the smartphone user did not authenticate with that Wifi Login/Captive Portal yet, the WL.Client.connect as well as connectOnStartup receive the HTML page of the portal for their connection request.

It seems the process/WL Framework is not stable in such a situation (see below). The problem is that the App **does not end up in the onSuccess or onFailure** procedures that we passed in as options object - there is a default Dialog being shown by Cordova/Worklight to the end user. This dialog even allows to view details of the request and the app environment.

So far, we did not find any event or hook to capture such an error situation. 

**( UPDATE Sept. 18: in the iOS native Objective-C WL Client Library this behavior is not the same - there: the onSuccess method is called in case of WL.Client.connect and the onFailure in case of invokeProcedure )** 

**Does anyone know how we could catch this error/exception?**

![enter image description here](https://i.stack.imgur.com/8VAbp.jpg)

![enter image description here](https://i.stack.imgur.com/Rjkuf.png)

```
09-05 10:27:48.526: D/App(8590): ondeviceready event dispatched
09-05 10:27:48.546: D/App(8590): wlclient init started
09-05 10:27:48.546: D/App(8590): Read cookies: null
09-05 10:27:48.546: D/App(8590): CookieMgr read cookies: {}
09-05 10:27:48.566: D/App(8590): before: app init onSuccess
09-05 10:27:48.566: D/App(8590): in startBusyIndicator
09-05 10:27:48.566: D/App(8590): busyIndicator is null or not visible, so create and show
09-05 10:27:48.566: D/App(8590): Exiting startBusyIndicator: [object Object]
09-05 10:27:48.566: D/App(8590): Call WL.Client.connect establish connection and trigger the direct update check
09-05 10:27:48.576: D/App(8590): Request [http://XXX:8080/apps/services/api/App/android/init]
09-05 10:27:48.596: D/App(8590): after: app init onSuccess
09-05 10:27:48.596: D/App(8590): wlclient init success
09-05 10:27:48.637: E/external/webkit/Source/WebKit/android/WebCoreSupport/WebRequest.cpp(8590): startReading called with a nonzero buffer
09-05 10:27:48.637: E/external/webkit/Source/WebKit/android/WebCoreSupport/WebRequest.cpp(8590): Read called with a nonzero buffer
09-05 10:27:48.667: D/App(8590): response [http://XXX:8080/apps/services/api/App/android/init] success: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
09-05 10:27:48.667: D/App(8590): <html xmlns="http://www.w3.org/1999/xhtml">
09-05 10:27:48.667: D/App(8590): <head>
09-05 10:27:48.667: D/App(8590): <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
09-05 10:27:48.667: D/App(8590): <title>Untitled Document</title>
09-05 10:27:48.667: D/App(8590): <style type="text/css">
09-05 10:27:48.667: D/App(8590):         
09-05 10:27:48.667: D/App(8590):               <p align="center"><strong>App </strong><strong>HotSpot WiFi Access</strong></p>
09-05 10:27:48.667: D/App(8590):               <div id="center_this">
09-05 10:27:48.667: D/App(8590):                 
09-05 10:27:48.667: D/App(8590):                 <div id="rules_window">
09-05 10:27:48.667: D/App(8590):                 
09-05 10:27:48.667: D/App(8590): 
09-05 10:27:48.667: D/App(8590):                 <p align=center style='text-align:center'><b>Terms of Use</b></p>
09-05 10:27:48.667: D/App(8590):                             <p>NOTICE: PLEASE READ CAREFULLY. THE FOLLOWING CONSTITUTES</p>
09-05 10:27:48.667: D/App(8590):                       
09-05 10:27:48.687: E/App(8590): [http://XXX:8080/apps/services/api/App/android/init] exception. Cannot read property 'userInfo' of null
09-05 10:27:48.857: V/webview(8590): SCROLL_TO_MSG_ID
09-05 10:27:48.857: V/webcore(8590): CLEAR_HISTORY arg1=0 arg2=0 obj=null
09-05 10:27:48.927: D/CordovaLog(8590): Uncaught TypeError: Cannot read property 'userInfo' of null
09-05 10:27:48.927: E/Web Console(8590): Uncaught TypeError: Cannot read property 'userInfo' of null at file:///data/data/com.App/files/www/default/wlclient/js/worklight.js:1487
09-05 10:27:50.489: D/DroidGap(8590): onMessage(spinner,stop)

```