A script-enabled browser is required for this page to function properly.

Handling Exceptions

All exceptions thrown by JDAPI extend JdapiException, which in its turn extends java.lang.RuntimeException. This means that almost every JDAPI method can throw an exception, and that you are not required to specifically write try/catch code for these exceptions. However, it is good practice to do this. As a suggestion, you could follow each try... block with several catch... blocks, catching first the JDAPI exceptions and then more generic exceptions.

JDAPI exceptions are:

JdapiStatusException Example

FormModule fmb = FormModule.open(filename); 
try
{
@ fmb.compile();
}
catch(JdapiStatusException e)
{
if(e.getStatusCode() == JdapiTypes.WARN_STID)
{
// this is a warning, the .fmb has still been created.
}
else
{
// the compilation failed - process the error.
}
}
catch(JdapiException e)
{
// the compilation failed - process the error
}