event.errorMessage

Type String
Event urlRequest
Revision Current Public Release (2017.3135)
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 )