contents   index   previous   next



seThrow

 

syntax:

   void

SEContext.seThrow(String message);

where:

se the current context

 

message the message of the error message in standard ScriptEase format.

 

return:

None

 

description:

An error object is constructed and set up in the SE.RETURN object. In addition, the error flag is turned on. If the wrapper function calling seThrow returns after this call, it’s result will be the given error.

 

The standard error message format for ScriptEase allows information on the type of the error to be included. By default, a stock Exception object is constructed with the text passed to this function. The extended form of the string is:

 

!TYPE NUM: MESSAGE

 

For instance, you could pass:

 

!SyntaxError 9999: You made a mistake.

 

 

 

The TYPE indicates the type of the error. An error object of this type is constructed to contain the error. The error types are:

 

SyntaxError

 

ReferenceError

 

ConversionError

 

ArrayLengthError

 

TypeError

 

URIError

 

EvalError

 

RegExpError

 

These types are defined by ECMA, including what errors are generated in normal error situations. When writing your own wrapper functions, pick the error type you feel is most appropriate.

 

The NUM indicates a resource number for your error message. Values of 10000 or more are reserved for user-errors, and you should use one. These numbers are used by the seGetResourceFunc to internationalize the text associated with various text strings, including error messages.

 

MESSAGE is the text of the error message.

 

see:

None

 


EXECUTING SCRIPTS