|
|
|
|
|
- How to get information about the error processed?
- Special case
ErrorChangeParameter (Function) In french: ErreurChangeParamètre Configures the automatic behavior that will be implemented if an error occurs in the current process. The previous behavior can be restored by ErrorRestoreParameter.
PROCEDURE InitialiseConnexion()
ErrorChangeParameter(epResult, False)
HDescribeConnection("Connexion", "utilisateur", "mot de passe", ...
"serveur", "base de données", hAccessHFClientServer)
HOpenConnection("Connexion")
RETURN True
Syntax
ErrorChangeParameter(<Behavior to implement> [, <Parameter 1> [, <Parameter 2>]])
<Behavior to implement>: Integer constant Behavior to implement: | | epCode | Current mode: the error is processed by programming (function return value test, use of ErrorOccurred, etc.). | epDisplayMessage | Displays the error message in a window that proposes the following choices: Retry, Cancel and Stop. | epDisplayMessageEndProcess | Displays the error message in a window that proposes the following choices: Cancel and Stop. | epDisplayMessageEndProgram | Displays the error message in a window that proposes the following choices: Stop and Restart (Stop by default). | epDisplayMessageRelaunchProgram | Displays the error message in a window that proposes the following choices: Stop and Restart (Restart by default). | epExecuteProcedure | Runs the procedure specified as parameter. This procedure must return one of the following constants:- opAnnuler: the function causes an error in the Procedure call code.
- opEndProcess: the error is validated and the user regains control
- opEndProgram (by Default): the application is stopped.
- opRetry: retry instruction
- opRelaunchProgram: stops and restarts the application.
| epGotoCaseError | Executes the code defined by the label: CASE ERROR: | epResult | Validates the errors. Exits the current process and returns the specified value (<Parameter 1> contains the value to return). | epResultError | Validates the errors. Exits from the current process, returns the specified value (<Parameter 1> contains the value to return) and propagates the error.The error is automatically processed by the higher level (if the error process is enabled), or by IF NOT xxx or IF ErrorOccurred. <Parameter 2> contains n additional error messages. | epReturn | Validates the errors. Exits from the current process. The error is not propagated if the automatic management of errors is enabled in the calling code. | epReturnError | Validates the errors. Exits from the current process and propagates the error.The error is automatically processed by the higher level (if the error process is enabled), or by IF NOT xxx or IF ErrorOccurred. The error is propagated if the automatic management of errors is enabled in the calling code. | It is possible to combine these constants with the epDisplayMessage constant: in this case, the error message will be displayed before executing the indicated behavior. <Parameter 1>: Optional parameter Optional parameter depending on the selected behavior. <Parameter 2>: Optional parameter Optional parameter depending on the selected behavior. Remarks How to get information about the error processed? ErrorInfo returns information about the error. The error handling mechanism, whether it is managed automatically (via the error handling window) or programmatically (with ErrorChangeParameter), is not triggered if the WLanguage function or the user procedure is in one of the following cases: SI PAS <Fonction ou procédure> ALORS // traitement de l'erreur FIN <Fonction ou procédure> SI ErreurDétectée = Vrai ALORS // traitement de l'erreur FIN The mechanism considers that the error is processed through programming and the automatic process is not triggered. Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|