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." );
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" ) );
}
// 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
- appendErrorMessage() [session] -Add to the error message.
- getErrorMessage() [session] - Get the current error message.
scraper on 07/16/2010 at 4:55 pm
- Printer-friendly version
- Login or register to post comments