Tip error handling on properties via methods

Every class holds a pointer on an 'AERROR' class array. This pointer called 'AERROR' is meant to handle errors and warning messages during CRUD operations.

Error handling on properties is carried out through different methods associated with the main class. These methods, called by Fmet instructions on this, are listed below.

ASETERROR(PRO,MES,NUM)

The this.ASETERROR method is used to set an error during a control:

  • PRO is a string identifying the context, for example, it might be CURPRO.
  • MES is a string containing the message in the acceptable language.
  • NUM is a numerical value, for example, an HTTP error code. This method is intended to set an error stored in a dedicated data structure. The error is supplied through the following property:

AGETMAXERROR(PROPERTY_NAME)

This method returns the highest error code found in the error classes for a given property. PROPERTY_NAME is a string identifying the property for which the error is requested. If the property is empty, the returned error relates to all errors that are found during class methods execution.

ADELETEERROR(PROPERTY_NAME)

This method cancels the errors associated with a given property. PROPERTY_NAME is a string identifying the property for which the error must be cancelled. If the property is empty, all errors that are found globally for the class will be cancelled.

Error code values

The error code can contain of the following values:

  • [V]CST_AINFO is a global integer constant. If used, it provides an information message.
  • [V]CST_AWARNING is a global integer constant. If used, it provides a warning message.
  • [V]CST_AERROR is a global integer constant. If used, it provides an error message.
  • [V]CST_AFATAL is a global integer constant. If used, it provides an error message.

Any error code value greater than [V]CST_AERROR will be considered an error.