PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • epExecuteProcedureOverall constant
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
ExceptionChangeParameter (Function)
In french: ExceptionChangeParamètre
Configures the automatic behavior that will be implemented if an exception occurs in the current process. The previous behavior can be restored by ExceptionRestoreParameter.
Syntax
ExceptionChangeParameter(<Behavior to implement> [, <Parameter>])
<Behavior to implement>: Integer constant
Behavior to implement:
epCodeStandard operating mode of exceptions.

Runs:
  • the WHEN EXCEPTION process
  • the automatic management of exceptions.
epGotoCaseExceptionRuns the code defined by: CASE EXCEPTION:
epExecuteProcedureRuns the procedure specified as parameter.

This procedure must return one of the following constants:
  • opEndProcess: Gives control back to the user.
  • opEndProgram (by default): The application is stopped.
  • opRelaunchProgram: Stops and restarts the application.
Versions 26 and later
epExecuteProcedureOverall
New in version 26
epExecuteProcedureOverall
epExecuteProcedureOverall
Executes the procedure passed as parameter, when used in the project initialization code. The procedure is called if no local exception process is active.

The procedure is active in the execution context (project, external stand-alone component, internal stand-alone component). If there is no procedure in the current context, the procedure is searched in the parent context recursively, up to the application level.
This procedure must return one of the following constants:
  • opEndProcess: Gives control back to the user.
  • opEndProgram (by default): The application is stopped.
  • opRelaunchProgram: Stops and restarts the application.
Remarks:
  • Each call replaces the previously specified procedure.
  • In most cases, the procedure allows writing the details of the problem encountered to a log file.
epReturnEnds the current process and does not propagate the exception
epResultExits from the current process and returns the value specified as parameter. The exception is not propagated.
<Parameter>: Optional parameter
Optional parameter depending on the selected behavior.
Remarks
Versions 26 and later

epExecuteProcedureOverall constant

The epExecuteProcedureOverall constant is used to handle exceptions in the entire project.
Reminder: to handle exceptions globally in the project, you can use the WHEN EXCEPTION block in the project initialization code. If the WHEN EXCEPTION process is declared in the project initialization code, it is valid for any error that occurs in the project. For more details, see General exception mechanism.
Calling ExceptionChangeParameter with the epExecuteProcedureOverall parameter in the project initialization code allows you to specify the WLanguage procedure to call in case of exception. The specified procedure is called if no local exception process is enabled.
Example:
This is the call in the project initialization code:
ExceptionChangeParameter(epExecuteProcedureOverall, _HandleGlobalException)
The WLanguage code automatically calls the _HandleGlobalException global procedure if an exception occurs in the project.
By using a global exception process for the entire project, it is possible to:
  • generate a debug dump with dbgSaveDebugDump,
  • send an email to the application developer with the dump file (or send the dump via FTP),
  • show an error to the end user and suggest to restart the application.
Example:
PROCEDURE _HandleGlobalException()
 
sFile is string
sFile = fTempPath() + ["\"] + "Dump.wdump"
 
// Saves a dump file
dbgSaveDebugDump(sFile)
 
// Opens the error window
Open(WIN_Error, ExceptionInfo(errFullDetails), sFile)
 
// In all cases,
// close the program
RESULT opEndProgram
The global procedure can be shared and reused in multiple projects.
New in version 26

epExecuteProcedureOverall constant

The epExecuteProcedureOverall constant is used to handle exceptions in the entire project.
Reminder: to handle exceptions globally in the project, you can use the WHEN EXCEPTION block in the project initialization code. If the WHEN EXCEPTION process is declared in the project initialization code, it is valid for any error that occurs in the project. For more details, see General exception mechanism.
Calling ExceptionChangeParameter with the epExecuteProcedureOverall parameter in the project initialization code allows you to specify the WLanguage procedure to call in case of exception. The specified procedure is called if no local exception process is enabled.
Example:
This is the call in the project initialization code:
ExceptionChangeParameter(epExecuteProcedureOverall, _HandleGlobalException)
The WLanguage code automatically calls the _HandleGlobalException global procedure if an exception occurs in the project.
By using a global exception process for the entire project, it is possible to:
  • generate a debug dump with dbgSaveDebugDump,
  • send an email to the application developer with the dump file (or send the dump via FTP),
  • show an error to the end user and suggest to restart the application.
Example:
PROCEDURE _HandleGlobalException()
 
sFile is string
sFile = fTempPath() + ["\"] + "Dump.wdump"
 
// Saves a dump file
dbgSaveDebugDump(sFile)
 
// Opens the error window
Open(WIN_Error, ExceptionInfo(errFullDetails), sFile)
 
// In all cases,
// close the program
RESULT opEndProgram
The global procedure can be shared and reused in multiple projects.

epExecuteProcedureOverall constant

The epExecuteProcedureOverall constant is used to handle exceptions in the entire project.
Reminder: to handle exceptions globally in the project, you can use the WHEN EXCEPTION block in the project initialization code. If the WHEN EXCEPTION process is declared in the project initialization code, it is valid for any error that occurs in the project. For more details, see General exception mechanism.
Calling ExceptionChangeParameter with the epExecuteProcedureOverall parameter in the project initialization code allows you to specify the WLanguage procedure to call in case of exception. The specified procedure is called if no local exception process is enabled.
Example:
This is the call in the project initialization code:
ExceptionChangeParameter(epExecuteProcedureOverall, _HandleGlobalException)
The WLanguage code automatically calls the _HandleGlobalException global procedure if an exception occurs in the project.
By using a global exception process for the entire project, it is possible to:
  • generate a debug dump with dbgSaveDebugDump,
  • send an email to the application developer with the dump file (or send the dump via FTP),
  • show an error to the end user and suggest to restart the application.
Example:
PROCEDURE _HandleGlobalException()
 
sFile is string
sFile = fTempPath() + ["\"] + "Dump.wdump"
 
// Saves a dump file
dbgSaveDebugDump(sFile)
 
// Opens the error window
Open(WIN_Error, ExceptionInfo(errFullDetails), sFile)
 
// In all cases,
// close the program
RESULT opEndProgram
The global procedure can be shared and reused in multiple projects.
Business / UI classification: Neutral code
Component: wd270vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment