setErrorMessage

void session.setErrorMessage ( String errorMessage ) (enterprise edition only)

Description

Set the current error message.

Parameters

  • errorMessage Desired error message, as a string.

Return Values

Returns void.

Change Log

Version Description
4.5 Available for enterprise edition.

Examples

Specify an Error Message

 // First set the flag indicating that an error occurred.
 session.setFatalErrorOccurred( true );

 // Append an error message.
 session.setErrorMessage( "An error occurred in the scraping session." );

Web Interface Feedback

 // Append an error message. Without flagging it as an error.
 // This will hijack the error message so it is more just a
 // status message. Don't hijack if there was a fatal error.

 if ( !session.getFatalErrorOccurred() )
 {
     session.appendErrorMessage( "Scraping Page: " + session.getv( "PAGE" ) );
 }

See Also