Exception handling

In order to catch Java™ exceptions within programs, use a TRY/CATCH block:
IMPORT JAVA java.lang.StringBuffer
MAIN
  DEFINE sb java.lang.StringBuffer
  LET sb = StringBuffer.create("abcdef")
  TRY
     CALL sb.deleteCharAt(50)   -- Throws StringIndexOutOfBoundsException
  CATCH
     DISPLAY "An exception was raised..."
  END TRY
END MAIN