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
  • Retrieving information about the exception
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Artificially triggers the security mechanism of WLanguage by throwing an exception. Then, this exception can be processed by an exception code written for this purpose. The exceptions are thrown in the WLanguage code only (and not in the framework).
Used in a web service, this function allows you to:
  • stop the current process,
  • return an error to the external application that uses the web service via the standard SOAP protocol.
    In the XML code returned by the web service, the error message is returned in the "faultstring" tag. The error number is not returned in a specific tag, it is contained in the text of the full error details found in the "detail" tag.
    Warning: When using this web service in a WINDEV, WEBDEV or WINDEV Mobile application, the error must be retrieved using the ErrorInfo function and not the ExceptionInfo function.
PHP Artificially triggers the PHP security mechanism by throwing an exception.
Example
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaUser code (UMC)Ajax
// -- Déclarations globales de Fenêtre
WHEN EXCEPTION
	// Selon le code de l'exception
	SWITCH ExceptionInfo(errCode)
		// Traitement de l'exception 1
		CASE 1 : ...
		// Traitement de l'exception 2
		CASE 2 : ...
	END
END
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaUser code (UMC)Ajax
// -- Clic de Bouton1
// Déclenche une exception 1
ExceptionThrow(1)
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget JavaAjax
// -- Clic de Bouton2
// Déclenche une exception 2
ExceptionThrow(2)
WEBDEV - Server codePHPAjax
// -- Clic de Bouton1
// Déclenche une exception d'avertissement
ExceptionThrow(exceptionWarning)
Syntax
ExceptionThrow(<Error number> [, <Message>])
<Error number>: Integer or constant
Number of the error to throw. This number (included between 1 and 1000) is defined by the developer.
PHP Level of the error to throw:
exceptionErrorError exception
exceptionInformationInformation exception
exceptionWarningWarning exception
<Message>: Optional character string
Message associated with the error.
Remarks

Retrieving information about the exception

The information about the exception is retrieved by ExceptionInfo:
  • ExceptionInfo(errCode) is used to retrieve the number of the exception.
  • ExceptionInfo(errMessage) is used to retrieve the message.
PHP Not available in PHP.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help