The Exception stereotype

In most cases stereotypes (see Stereotypes) are associated with a particular technology, such as a data access technology like SQL or a particular UI technology. The Exception stereotype is itself an exception to this rule. This keyword specializes a record so that you can handle or throw a particular type of exception within your program code. For a more detailed discussion, see Exception handling.

When you stereotype a record as an Exception, EGL predefines two implicit fields for you:

For system exceptions, these fields contain an identifier like "EGL0050E" and a description like "Overflow from expression 0 / 0." If the error is one that set sysVar.errorCode in EGL version 6, the description includes the value of that error code (see errorCode).

When you create an Exception record, you automatically have access to these fields without having to define them yourself. (For more about implicit fields, see Properties.) In many cases, these are the only fields you need. If you need additional fields, declare them inside the record definition, as in the following example:
Record TransactionException type Exception
  transType INT;
end

EGL defines a number of core Exception records for you; for more details, see the Appendix "EGL Exception records."

Additional Exception records are defined for various technologies; see the related reference links at the end of the topic for those that you might be using.