语法,
TRY.
... " TRY block (application coding)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
...
CLEANUP.
... " CLEANUP block (cleanup context)
ENDTRY.
如果想处理所有异常,使用
catch cx_root.
- A TRY block, in which exceptions can occur.
This exception block consists of all the statements between the TRY and the CATCH statement. - One or more CATCH blocks for catching exceptions.
These exception blocks are initiated with CATCH and ended with a further CATCH, CLEANUP, or ENDTRY. - A CLEANUP block for cleanup work after the exceptions have been caught.
This statement block is initiated by CLEANUP and ended with ENDTRY. A TRY-ENDTRY structure must not contain more than one CLEANUP block in precisely this position.