Error

 

Error Overview

Analytic Information Server has a heap or object data type named Error to distinguish errors from other data types. The Error is a container which may hold text and is case-sensitive, may include blanks but not special characters, may be up to 32767 characters in length, and must begin and end with an exclamation mark (!).

The Error type does not behave like the other Analytic Information Server types. If an Error value is reference, the function referencing the Error value immediately terminates and calls the onError function which displays the Error value. Therefore, the setq function will not work, (nor will the ref function). It is not possible to compare Error values nor is it possible to add methods to the Error type.

When to Use

The Error native data type is ideal for returning text describing an error condition. Having the Error data type eliminates the need to overload other data types to handle error conditions.

Constant Form

An Error constant may hold text and is case-sensitive, may include blanks but not special characters, may be up to 12 characters in length, and must begin and end with an exclamation mark (!). Some examples:

!bad argument!

!illegal syntax!

!out of memory!

Object or Heap Data Type

The Error Data Type is an example of an AIS Object Data Type.

The Analytic Information Server Object Types are stored in the Heap and are managed by the Heap manager. The Analytic Information Server Heap manager supports object resizing, garbage collection, and anti-fragmentation algorithms so that the user may concentrate on the analysis and modeling of data rather than on memory management. Without exception, all of the Object types are identified by an object id. The object id identifies a block of memory, managed by the Analytic Information Server memory manager, in which the Object's data is stored.

The Analytic Information Server Heap Object and Native Data types can be saved and loaded to and from persistent (disk file) storage at any time. Words with immediate data are saved on disk in fixed length records equal to the size of the Word. Words with Heap object references are saved in fixed length records, which are automatically expanded to include the contents of the Heap object, and any objects referenced by the Heap object, etc. This feature is called Object Closure Management and is automatic with every Analytic Information Server database save.

Analytic Information Server Words may be loaded from any database repository record at any time. If the data in the record is immediate, the database load fills the Word with the immediate data. If the data in the record is an object closure, the database load fills the Word with a Heap object reference, and all of the objects in the record are loaded back into the Heap with the same referential relationships they had when they were saved in the repository.

 

Data Type Examples

The Error object can be demonstrated by the following examples.

Example_Error_errorTrap_001 Example_Error_error_001 Example_Error_isError_001 Example_Error_isIdentical_007
Example_Error_onError_001