Skip to main content

methodCalledOnError

methodCalledOnError( { scope : integer } ) : string

ParameterTypeDescription
scopeinteger->Scope of the error method
resultstring<-Name of method called on error

Description

The methodCalledOnError command returns the name of the method installed by onErrCall for the current process or the defined scope.

In the scope parameter, pass the execution context for which you want to get the name of the error handler method. You can use one of the following constants:

ConstantValueDescription
ek errors from components2Errors that occurred in components
ek global1Errors that occurred in the global execution context of the project
ek local0Errors that occurred in the local execution context (default if scope parameter is omitted)

If no method has been installed for the scope, an empty string ("") is returned.

Example

 var methCurrent, refs : string
methCurrent = methodCalledOnError
onErrCall("NewMethod")
//If the file cannot be opened, an error is generated
refs = jsonParse(file("/PACKAGE/Project/Sources/Shared/assets/files/i18n.json").getText())
//Reinstallation of previous method
onErrCall(methCurrent)

See also

.onErrCall()