EXCEPTION HANDLER
EXCEPTION HANDLER action
Function | Action defines a start of actions which handle an error (so called exception handler) and defines an area of their operation. |
Declaration | EXCEPTION_HANDLER |
Description | EXCEPTION_HANDLER action defines the start of actions which handle the error (so
called exception handler) and defines the area of their operation.
If EXCEPTION_HANDLER action is in some procedure the exception handling ends on
this action and starts either by previous EXCEPTION_HANDLER
action or by the
procedure. EXCEPTION_HANDLER action must not define the error handler for ON ERROR action. For example: |
| PROCEDURE Proc2
; incorrect placement of the command
ON ERROR Error
INT _i
CALL Proc1
Error:
EXCEPTION_HANDLER
; exception handling from the start of procedure to EXCEPTION_HANDLER action
END Proc2 |
| When EXCEPTION_HANDLER action is executed, it is interpreted as RETURN action. Following two procedures are the same: |
| PROCEDURE Proc1
; actions
; .....
RETURN
EXCEPTION_HANDLER
; exception handling
END Proc1 |
| or |
| PROCEDURE Proc1
; actions
; .....
EXCEPTION_HANDLER
; exception handling
END Proc1 |
| EXCEPTION_HANDLER action may handle the exceptions which occur while their are serviced: |
| PROCEDURE Proc3
; actions
; ....
EXCEPTION_HANDLER
; exception handling from start of procedure to EXCEPTION_HANDLER action
EXCEPTION_HANDLER
; exception handling from the previous EXCEPTION_HANDLER action
END Proc3 |
Related pages: