GenericException

Provides generic exception wrapping.

Where to Use

Use these methods to define exception handling in your JavaScript code.

Method Summary

Method SummaryDescription
initialize(errorMessage) Method called by the Prototype JavaScript Framework during object creation.
getMessage() Gets the error message.
toString() Converts the error message to a string.

Method Detail

initialize(errorMessage)

Called by the Prototype JavaScript Framework during object creation to initialize a new instance of this class. Provide the parameter value but do not directly call this method.

Input Fields

Parameters:

  • errorMessage - (string) The error message.

Output Fields

Returns: void

Example

var jerr = new  GenericException("This is an error");

getMessage()

Gets the error message.

Input Fields

Parameters:

  • None

Output Fields

Returns: (string) The error message.

Example

var jerr = new  GenericException("This is an error");
gs.print(jerr.getMessage());

Output:

*** Script: This is an error

toString()

Converts the error message to a string.

Input Fields

Parameters:

  • None

Output Fields

Returns: (string) The error message.

Example

var jerr = new  GenericException("This is an error");
gs.print(jerr.toString());

Output:

*** Script: This is an error