event.errorMessage

Type String
Event urlRequest
Revision Release 2022.3683
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( "https://solar2d.com/" )

webView:addEventListener( "urlRequest", webListener )