company logo

Error and exception handling

Keywords:  exceptionmethod error

The ODABA Script Interface supports specific error and exception handling. Both can be used to control the process flow within OSI methods. Within OSI methods, one may generate errors and exceptions and handle those in a standard way.

Each OSI method may define an ON_ERROR block after the PROCESS section. This error block is not executed normally, but only, when an error or exception has fired using the ERROR() or EXCEPTION() function.

bool Person::SampleEH()

{

variables

  bool      retval = true;

process

  if ( ! HasData() )                                  

    error("no data available");

  Print(Person);

on_error

  retval = false;

final

  return(retval);

}

Related topics