ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Exception functions
  • How to get information about the error processed?
  • Special case
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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
// Initializes the connection to the HFSQL Client/Server database
// Returns True if everything is OK, False otherwise
PROCÉDURE InitializeConnection()
// If an error occurs, exit and return False
ErrorChangeParameter(epResult, False)
// Describe the connection
HDescribeConnection("Connection", "user", "password", ...
"server","database", hAccessHFClientServer)
// Open the connection
HOpenConnection("Connection")
// OK
RETURN True
 
// Code replaced
// Initializes the connection to the HFSQL Client/Server database
// Returns True if everything is OK, False otherwise
// PROCEDURE InitializeConnection()
// Describe the connection
// IF HDescribeConnection("Connection", "user", "password", ...
// "server", "database", hAccessHFClientServer) = False THEN
// RESULT False
// END
 
// Open the connection
// IF HOpenConnection("Connection") = False THEN
// RESULT False
// END
 
//  OK
// RESULT True
Syntax
ErrorChangeParameter(<Behavior to implement> [, <Parameter 1> [, <Parameter 2>]])
<Behavior to implement>: Integer constant
Behavior to implement:
epCodeCurrent mode: the error is processed through programming (test the return value of the functions, using ErrorOccurred, ...)
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:
  • opCancel: the function triggers an error in the code used to call the procedure.
  • opEndProcess: the error is validated and the user takes control
  • opEndProgram (by default): the application is stopped.
  • opRetry: retries the statement
  • opRelaunchProgram: stops and restarts the application.
epGotoCaseErrorRuns the code defined by: CASE ERROR:
epResultValidates the errors. Exits from 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.
These constants can be combined with the epDisplayMessage constant: in this case, the error message will be displayed before running the specified 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:
IF NOT <Function or procedure> THEN
// process the error
END
<Function or procedure>
IF ErrorOccurred = True THEN
// process the error
END
The mechanism considers that the error is processed by programming and the automatic process is not triggered.
Business / UI classification: Neutral code
Component: wd290vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help