Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

FunctionAction defines a start of actions which that handle an error (so-called exception handler) and defines an area of their operation.
Declaration


Blok kódu
languageesl
themeConfluence
EXCEPTION_HANDLER


DescriptionEXCEPTION_HANDLER action defines the start of actions which that handle the error (so called exception handler) and defines the area of their operation.
According to the context where the action is used, it can cause:
  • End of script execution - if the action is used out of the procedure.
  • End of procedure execution - if the action is used within the procedure.
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.
If EXCEPTION_HANDLER action is out of procedure it defines the exception handler for errors occurring in the actions of an initialization part of script and in initialization of the global variables.

EXCEPTION_HANDLER action must not define the error handler for ON ERROR action.

For example:



Blok kódu
languageesl
themeRDark
 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 The following two procedures are the same:


Blok kódu
languageesl
themeRDark
PROCEDURE Proc1
  ; actions
  ; .....
 
  RETURN
 EXCEPTION_HANDLER
  ; exception handling
 END Proc1 



or


Blok kódu
languageesl
themeRDark
 PROCEDURE Proc1
  ; actions
  ; .....
 
 EXCEPTION_HANDLER
  ; exception handling
 END Proc1 



EXCEPTION_HANDLER action may handle the exceptions which occur while their there are serviced:


Blok kódu
languageesl
themeRDark
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


...