event.errorCode

Type Number
Event urlRequest
Revision Current Public Release (2018.3326)
Keywords urlRequest, errorCode

Overview

An error code if a problem occurred in the URL request of a native.newWebView() or native.showWebPopup() call. Otherwise, returns nil.

A platform-specific integer for the error which is not language dependent. This property only exists when an error occurs.

Example

local function webListener( event )
 
    if ( event.errorCode ) then
        native.showAlert( "Error!", event.errorMessage, { "OK" } )
    end
end
 
local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
webView:request( "http://www.coronalabs1.com/" )
 
webView:addEventListener( "urlRequest", webListener )