WHEN EXCEPTION IN ~ USE ~ END WHEN ☆
WHEN EXCEPTION IN when-body USE exception-handler END WHEN
When-body
The portion between a WHEN-EXCEPTION-IN line and a USE line is called a when-body.
If the when-body has been completed normally, the cotrol proceeds to the the next line of the END-WHEN.
Otherwise, the control branches to the exception-handler.
Exception-handler
The lines written between a USE line and a END-WHEN line is called an exception-handler.
If the control has reached the END-WHEN line, the control escapes the when-block and proceeds to the next line.
No branch out of an exception-handler using GOTO or IF-THEN-line_number is allowed.
The followings are statements that can be used in an exception-handler.
RETRY
resumes the statement that has caused the exception.
CONTINUE
resumes the next, provided that the line where the exception has occurred is the beginning or part of a block, the control proceeds to the next line of the block. For example, if an exception has occurred in a FOR line, the control proceeds to the next line of the NEXT line. If an exception has occurred in a ELSEIF-line, the control proceeds to the next line of the corresponding END-IF.