This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
Method called on error

Method called on error 


 

Method called on error {( scope )} -> Function result 
Parameter Type   Description
scope  Integer in Scope of the error method
Function result  String in Name of method called on error

The Method called on error command returns the name of the method installed by the ON ERR CALL command 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:

 

Constant Value Comment
ek errors from components 2

Errors that occurred in components

ek global 1

Errors that occurred in the global execution context of the project

ek local 0

Errors 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  

This command is particularly useful in the context of components because it enables you to temporarily change and then restore the error-catching methods:

 $methCurrent:=Method called on error
 ON ERR CALL("NewMethod")
  ` If the document cannot be opened, an error is generated
 $ref:=Open document("MyDocument")
  ` Reinstallation of previous method
 ON ERR CALL($methCurrent)



See also 

Error Handler
ON ERR CALL

 
PROPERTIES 

Product: 4D
Theme: Interruptions
Number: 704

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v6.8.1
Modified: 4D v19 R8

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)