ExceptionHandler: String;
The ExceptionHandler property determines an exception errors handler that is used when working in the repository.
A function, that is used for global processing of exception errors, should be specified as a value of this property. Depending on where the function is implemented, the value can be specified in the following formats:
<module/form identifier>.<macro name>
<module/form identifier>.<class name>.<macro name>
<assembly identifier>.<macro name>
<assembly identifier>.<class name>.<macro name>
A function or a static class function, having the following signature, can be a handler:
Function <function name>(<parameter name>: IException): Boolean
Begin
End Function <function name>;
If the function returns True, the found error is considered processed one. If the function returns False, the error will be forwarded to the platform level and handled by the system error handler.
NOTE. Calling of global handler is not recursive. If the exception occurred in the handler, the source error will be forwarded to the platform level and handled by the system error handler.
Executing the example requires a module with the Mod_Exception identifier. This module has implementation of the OnException function that has the specified signature.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Begin
MB := MetabaseClass.Active;
MB.ExceptionHandler := "Mod_Exception.OnException";
MB.ExceptionMailAddress := "support@fsight.ru";
End Sub UserProc;
After executing the example the specified function is set as an errors handler for the current repository. An e-mail address is also specified. Errors messages are suggested to be sent on this e-mail address.
See also: