event.errorCode

Type Number
Event urlRequest
Revision 2017.3184
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 )