Overriding the showErrorFromNative Function

The generated JavaScript allows you to override the behavior of the showErrorFromNative function using the customBeforeReportErrorFromNative(errorString)and customAfterReportErrorFromNative(errorString) methods.

This shows an example of how to override or customize the error message based on the returned numeric error codes through customBeforeReportErrorFromNative.

Example 1

function customBeforeReportErrorFromNative(errorString) {
	var errorCode = getURLParamFromNativeError("errCode", errorString);
	// 500 and above are network errors
   if ( errorCode >= 500 )
	{
		// Could check lang global variable if so desired
		//if ( lang == ... )
		{
			// Show your own custom error message based on errorCode
			showAlertDialog("Do you have a network connection?", "My custom error");
			// return false to by pass default behavior
			return false;
		}
	}
    return true;
}

Identified error scenarios include: