Goodies
Of all the BSPH_ prefixed methods created in the Host database, only BSPH_GET_MAIL_INFO is important to you and must be modified in order to receive ATL error emails (see 1.4).
The other BSPH_ methods are of no use to you, as they are called by the component methods.
However, among the component's methods, we've published a few that you may find useful in your own code.
4.1 Advanced error handling
3 types of error handling are provided:
4.1.1 Normal error handling
By installing ON ERR CALL (“BSPK_ERROR_HANDLER”), you'll benefit from a full error handling in the current process, with an alert displayed and an email sent according to the values entered in BSPH_GET_MAIL_INFO.
This mode is typically used for processes executed on the client workstation with a user interface, and you wish to inform the user of the error. The user can either stop the code execution or continue (at his own risk, exactly as with the classic 4D error).
If the email has gone through correctly, he is also informed that the developer has been notified by email, which may reassure him.
4.1.2 Silent error handling
By installing ON ERR CALL (“BSPK_ERROR”), you'll benefit from an error handling in the current process, without displaying an alert, but sending an email based on the values entered in BSPH_GET_MAIL_INFO.
This mode is typically used for processes running on a server or without an interface.
4.1.3 Mute error handling
By installing ON ERR CALL (“BSPK_ERROR_MUTED”), you 'll benefit from an error handling in the current process, without any alerts or information being sent to the developer.
This mode is typically used for known, non-bypassable errors, which do not merit an alert and which do not affect the correct operation of the code.
4.1.4 Test method
To test these three error modes, you can call the BSPK_ERROR_TEST method.
No parameter: triggers an error in normal error handling mode.
- With the name of one of the 3 methods above as a parameter, you force the error mode of the test.
Example: BSPK_ERROR_TEST (“BSPK_ERROR_SILENT”)
- All other parameters will be ignored.
4.2 Execute Method
The BSPK_EXECUTE_METHOD command is used to execute a 4D method when the Development menu is not available.
You can choose to run the method on 4D Server.
In all cases, you will be prompted for confirmation before executing the method.
The chosen method will be launched in a new process on the server, but in local mode it will run in the current process. If you want a different behavior, you can either make sure to call BSPK_EXECUTE_METHOD in the target process, or modify the BSPH_EXECUTE_METHOD method to your liking, for example to propose a choice on the fly and create a new process.
4.3 Execute code
The BSPK_EXECUTE_CODE command opens an input dialog in which you can enter or paste 4D code, whether classical or ORDA.
This code must be in English. 4D's French syntax will not work.
This action obviously requires extreme caution and must be carried out with full knowledge of the facts, after duly testing the code to be executed.
A final confirmation is required before the code is executed.