ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Exception functions
  • How to get information about the error processed?
  • Special case
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
// Initialise la connexion à la base HFSQL Client/Serveur
// Renvoie Vrai si tout s'est bien passé, Faux sinon
PROCEDURE InitialiseConnexion()
// En cas d'erreur, on sort en renvoyant Faux
ErrorChangeParameter(epResult, False)
// Description de la connexion
HDescribeConnection("Connexion", "utilisateur", "mot de passe", ...
	"serveur", "base de données", hAccessHFClientServer)
// Ouverture de la connexion
HOpenConnection("Connexion")
// OK
RETURN True 

// Code remplacé
// Initialise la connexion à la base HFSQL Client/Serveur
// Renvoie Vrai si tout s'est bien passé, Faux sinon
// PROCEDURE InitialiseConnexion()
// Description de la connexion
// SI HDécritConnexion("Connexion", "utilisateur", "mot de passe", ...
// 	"serveur", "base de données", hAccèsHFClientServeur) = Faux ALORS
// RENVOYER Faux
// FIN

// Ouverture de la connexion
// SI HOuvreConnexion("Connexion") = Faux ALORS
//	RENVOYER Faux
// FIN

//  OK
// RENVOYER Vrai
Syntax
ErrorChangeParameter(<Behavior to implement> [, <Parameter 1> [, <Parameter 2>]])
<Behavior to implement>: Integer constant
Behavior to implement:
epCodeCurrent mode: the error is processed by programming (function return value test, use of ErrorOccurred, etc.).
epDisplayMessageDisplays the error message in a window that proposes the following choices: Retry, Cancel and Stop.
WEBDEV - Server code This constant is not available.
epDisplayMessageEndProcessDisplays the error message in a window that proposes the following choices: Cancel and Stop.
WEBDEV - Server code This constant is not available.
epDisplayMessageEndProgramDisplays the error message in a window that proposes the following choices: Stop and Restart (Stop by default).
WEBDEV - Server code This constant is not available.
epDisplayMessageRelaunchProgramDisplays the error message in a window that proposes the following choices: Stop and Restart (Restart by default).
WEBDEV - Server code This constant is not available.
epExecuteProcedureRuns 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.
epGotoCaseErrorExecutes the code defined by the label: CASE ERROR:
epResultValidates the errors. Exits the current process and returns the specified value (<Parameter 1> contains the value to return).
epResultErrorValidates 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.
epReturnValidates the errors. Exits from the current process.
The error is not propagated if the automatic management of errors is enabled in the calling code.
epReturnErrorValidates 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.

Special case

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
Component: wd300vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/19/2024

Send a report | Local help