PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Automatic management of exceptions
  • Implementing the automatic management of exceptions
  • Running the error process ("CASE EXCEPTION:" in the code)
  • Running a procedure of exception process:
  • Functions for automatic management of exceptions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The management of exceptions can be customized by process.
You can choose to use an automatic exception process or opt for an advanced exception management via the different WLanguage functions.
Important: The automatic management of errors and exceptions operates for the process for which it was defined. To use a global and unique process if an exception occurs, you must use the mechanism of general exceptions.
AndroidAndroid Widget Java Caution: The mechanism of general exceptions is not available.. Only the specific exceptions (WHEN EXCEPTION IN) are available.
Versions 19 and later
WEBDEV - Browser code The automatic exception process is now available in Browser code.
WEBDEV - Browser code The automatic exception process is used to manage the WLanguage errors. The errors found in the external Javascript files are not supported.
New in version 19
WEBDEV - Browser code The automatic exception process is now available in Browser code.
WEBDEV - Browser code The automatic exception process is used to manage the WLanguage errors. The errors found in the external Javascript files are not supported.
WEBDEV - Browser code The automatic exception process is now available in Browser code.
WEBDEV - Browser code The automatic exception process is used to manage the WLanguage errors. The errors found in the external Javascript files are not supported.
Automatic management of exceptions
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesWindowsAndroidiPhone/iPadWindows MobileJava

Implementing the automatic management of exceptions

To implement the automatic management of exceptions:
  1. In the code editor, display the process where the exceptions must be managed: initialization code, click code, procedure, ...
  2. In the code header, click "When exception: by program".
  3. The window that is displayed allows you to specify the type of automatic process to perform:
An advanced management of errors can be performed by ExceptionChangeParameter.
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesWindowsAndroidiPhone/iPadWindows MobileJava

Running the error process ("CASE EXCEPTION:" in the code)

If this option is selected, a code line is added into "CASE EXCEPTION:". The code lines following this statement will be run when an exception occurs in the previous code lines (or in a process called by these code lines).
For example:
CASE EXCEPTION:
// Display an error message
Error("A fatal error was detected.", ExceptionInfo(), "", "Stop the procedure.")
// Manage this error
...
This option is recommended to group all the exception processes that may occur.
WINDEVWEBDEV - Server codeReports and QueriesWindowsAndroidiPhone/iPadWindows MobileJava

Running a procedure of exception process:

If this option is selected, the specified procedure will be automatically run to process the error when an exception occurs in the current process (or in the processes called by the current process). This option is recommended if a procedure used to process the exceptions is already found in your application. This procedure will be automatically called when an exception occurs. No test to run.
This procedure can return one of the constants found in the table below.
Depending on the constant returned, WINDEV, WEBDEV or WINDEV Mobile will perform the corresponding process.
opCancelRestarts the exception
opEndProcessThe function that triggered the error returns an error and the current process stops. Equivalent to ReturnToCapture
opEndProgramThe function that triggered the error returns an error and the program stops. Equivalent to EndProgram
opRelaunchProgramEnds the application and automatically restarts the application.
AndroidJava This constant is not available in Java.
Functions for automatic management of exceptions
Versions 10 and later
ExceptionChangeParameter
New in version 10
ExceptionChangeParameter
ExceptionChangeParameter
Configures the automatic behavior that will be implemented if an exception occurs in the current process.
Versions 16 and later
ExceptionDisplay
New in version 16
ExceptionDisplay
ExceptionDisplay
Displays the standard window of exceptions with the content of the current exception.
Versions 09 and later
ExceptionEnable
New in version 09
ExceptionEnable
ExceptionEnable
Re-enables the current exception process if the exception was corrected.
Versions 09 and later
ExceptionInfo
New in version 09
ExceptionInfo
ExceptionInfo
Retrieves information about the current exception.
Versions 10 and later
ExceptionPropagate
New in version 10
ExceptionPropagate
ExceptionPropagate
Propagates an exception.
Versions 10 and later
ExceptionRestoreParameter
New in version 10
ExceptionRestoreParameter
ExceptionRestoreParameter
Restores the exception process of a process.
Versions 09 and later
ExceptionThrow
New in version 09
ExceptionThrow
ExceptionThrow
Artificially triggers the security mechanism of WLanguage by throwing an exception.
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment