AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de excepciones
  • 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
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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: automatic error and exception handling works only for the processing for which it is defined.. To use a global and unique process if an exception occurs, you must use the mechanism of general exceptions.
WEBDEV - Código Navegador 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

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 on "When exception: by program".
  3. The window that is displayed allows you to specify the type of automatic process to perform:
ExceptionChangeParameter can be used for advanced error management.

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

If this option is selected, a line of code is added into "CASE EXCEPTION:". The lines of code following this statement will be run when an exception occurs in the previous lines of code (or in a process called by these lines of code).
For example:
CASE EXCEPTION:
// Affichage d'un message d'erreur
Error("Une erreur fatale a été détectée.", ExceptionInfo(), "", "Arrêt de la procédure.")
// Gestion de cette erreur
...
This option is recommended to group all the exception processes that may occur.

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 the SetFocusAndReturnToUserInput function.
opEndProgramThe function that triggered the error returns an error and the program stops. Equivalent to the EndProgram function.
opRelaunchProgramEnds the application and automatically restarts the application.
Functions for automatic management of exceptions
ExceptionChangeParameterConfigures the automatic behavior that will be implemented if an exception occurs in the current process.
ExceptionDisplayMuestra la ventana estándar de excepciones con el contenido de la excepción actual.
ExceptionEnableVuelve a habilitar la actual excepción Process si la excepción fue corregida.
ExceptionInfoRecupera información sobre la excepción actual.
ExceptionPropagatePropagates an exception.
ExceptionRestoreParameterRestaura la excepción Process de una Process.
ExceptionThrowActiva artificialmente el mecanismo de seguridad de WLanguage lanzando una excepción.
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 19/09/2024

Señalar un error o enviar una sugerencia | Ayuda local