event.errorMessage

Type String
Event urlRequest
Revision 2017.3060
Keywords urlRequest, errorMessage

Overview

A string with an description of an error that occurred in the URL request of a native.newWebView() or native.showWebPopup() call. This property only exists when an error has occurred, otherwise it is undefined. It may be localized depending on the user's language setting.

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 )