Salesforce

Exception and Error Handling (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Exception and Error Handling (Magic xpa 3.x)

When an error or exception occurs during Magic xpa program execution, Magic xpa displays an error message indicating the error ID and a brief description.

The error ID, if shown as CPFxxxx, corresponds to the IBM i CPF error messages. You can consult the CPF message guide or use the WRKMSGD command on the IBM i server to get more information about the error.

You can override this default behavior by specifying the NOMSGBOX keyword for database definition properties. The last error occurred can be retrieved by using the UDF RTVERRID command.

The syntax used to retrieve the last error that occurred is:

UDF(‘MGEAC32.RTVERRID’, A, B, C, D)

Where:

  • A, a string variable, represents the system name

  • B, a string variable, represents the CPF error ID

  • C, a string variable, represents the CPF message description and reason

  • D, a numeric value, represents the length of the CPF message description and reason variable

The Magic xpa function DbERR() also returns an error number. DbERR() clears the error code at the beginning of each record cycle, and RTVERRID preserves the error ID until the next error occurs.

Reference
Attachment 
Attachment