Example

Visual LANSA Framework

Example

If your program had to locate the details of an employee and this information could not be found, you would have encountered a fatal error situation indicative of some sort of database corruption.  In such a situation you might use the application error handler like this:  

 

Fetch Fields(#SURNAME) From_File(PSLMST) With_Key(#EMPNO)
If_Status Is_Not(*OKAY)
   Invoke #AvFrameworkManager.avHandleError Curr_Comp(*component)
       Curr_Rout(ButtonHandler) Curr_Cmd(FETCH) 
       Curr_Info('Employee details could not be accessed.') 
       Curr_Retc(#io$Sts)
Endif

 

The standard error handler then does a number of things (depending up on how your Framework is configured) including:

  • Displaying the fatal error details to the user.
  • Recording the error details in a file.
  • Emailing the error details to a nominated support email address.
  • Terminating the Framework.