IRISLIB database
Error Class Reference

SYSTEM.Error is a generic error container used to return error information reported from various sources. More...

Inheritance diagram for Error:
Collaboration diagram for Error:

Public Member Functions

_.Library.Status OnClose ()
 SYSTEM.Error is a generic error container used to return error information reported from various sources. More...
 
_.Exception.AbstractException AsException ()
 asException() - return a new instance of an exception
 
_.Library.Integer findXRef (_.Library.String messageDomain)
 findXRef - lookup a cross-referenced message in the requested domain
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.SYSTEM.Error FromException (_.Exception.AbstractException pException)
 fromException() - instantiate a new SYSTEM.Error object from an exception object.
 
_.SYSTEM.Error FromSQLCode (_.Library.Integer pSQLCODE, _.Library.String pMessage)
 fromSQLCode() - instantiate a new SYSTEM.Error object from an SQLCODE and message.
 
_.SYSTEM.Error FromXSQL (_.Library.String pDomain, _.Library.Integer pXSQLCODE, _.Library.String pMessage)
 FromXSQL() - instantiate a new SYSTEM.Error object from an error code that originates from and XSQL procedure. More...
 

Public Attributes

 Code
 The error code - for CacheError (messageId = 5002) this is the $ZError code ($e($ze,1,$f($ze,1,">")) More...
 
 Message
 Additional free text information about the error, may be null. More...
 
 SQLCode
 SQLCode of this error, may be null. More...
 
 Severity
 Severity is an indication as to the severity of the error being reported. More...
 
 Status
 The Status code of this error. More...
 
 messageId
 This is computed from the value of Status. More...
 

Private Member Functions

_.Library.Status OnNew (_.Library.Status pStatus, _.Library.String pSQLCode, _.Library.String pMessage, _.Library.Integer pSeverity)
 Create a new error given a Status or an SQLCODE and message value. More...
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

SYSTEM.Error is a generic error container used to return error information reported from various sources.

Errors can occur in several different ways. A Status value can be returned, an ObjectScript error can be trapped and reported as $ZERROR, an SQLCODE error can be reported by an SQL statement, or an error number from an XSQL procedure can be reported. All of these errors must be recognizable and be able to be reported in various forms. xDBC expects an SQLCODE while other systems might want Status values.

This class provides a mechanism for consistent reporting and detection.

Member Function Documentation

◆ OnClose()

_.Library.Status OnClose ( )

SYSTEM.Error is a generic error container used to return error information reported from various sources.

Errors can occur in several different ways. A Status value can be returned, an ObjectScript error can be trapped and reported as $ZERROR, an SQLCODE error can be reported by an SQL statement, or an error number from an XSQL procedure can be reported. All of these errors must be recognizable and be able to be reported in various forms. xDBC expects an SQLCODE while other systems might want Status values.

This class provides a mechanism for consistent reporting and detection.

This callback method is invoked by the <METHOD>Close</METHOD> method to

provide notification that the current object is being closed.

The return value of this method is ignored.

Reimplemented from RegisteredObject.

◆ OnNew()

_.Library.Status OnNew ( _.Library.Status  pStatus,
_.Library.String  pSQLCode,
_.Library.String  pMessage,
_.Library.Integer  pSeverity 
)
private

Create a new error given a Status or an SQLCODE and message value.

Severity applies to

certain XSQL systems (TSQL only for now)

◆ FromXSQL()

_.SYSTEM.Error FromXSQL ( _.Library.String  pDomain,
_.Library.Integer  pXSQLCODE,
_.Library.String  pMessage 
)
static

FromXSQL() - instantiate a new SYSTEM.Error object from an error code that originates from and XSQL procedure.

This is called from generated code for TSQL RAISERROR (v27) and Informix RAISE EXCEPTION (v25)

Member Data Documentation

◆ Code

Code

The error code - for CacheError (messageId = 5002) this is the $ZError code ($e($ze,1,$f($ze,1,">"))

for SQLError (messageId = 5540) this is the SQLCODE value. For most other messageId's, this is 0 (zero). Code simply provides additional detail for a Status error  

◆ Message

Message

Additional free text information about the error, may be null.

 

◆ SQLCode

SQLCode

SQLCode of this error, may be null.

 

◆ Severity

Severity

Severity is an indication as to the severity of the error being reported.

The value, 0-25, not

only provides information, it is a hint to the error processor as to what action to take. For TSQL this means returning control to the current batch or procedure at the point following the statement reporting the error, exiting the current batch or procedure or terminating the connection. TSQL defines severity of 10-19 as transferring to the CATCH block. InterSystems IRIS will exit the current procedure if severity is > 19.  

◆ Status

The Status code of this error.

An error will ALWAYS have a Status value

 

◆ messageId

messageId

This is computed from the value of Status.