Error Handling Scheme Modifiers
CodeSMART Error Handling Schemes can be identified by their name. By inserting
a scheme name in a special comment at the top of a component or procedure you
can force that error handling scheme to be used for that component or procedure,
even if the respective component or procedure has an error handling assignment.
Error handling scheme modifiers have the biggest priority while deciding what error
handler should be used for a procedure.
Error handling engine priorities pyramid
To insert error handling scheme modifiers:
-
Open the code module of the component where you want to insert the error
handling scheme modifier.
-
Optional. Move the cursor to the component declaration area if you want
to insert a modifier at component level or into a procedure if you want
to insert the modifier in a procedure.
-
Select the desired modifier from the Modifiers popup of the Code Edit
Tools toolbar. A special CodeSMART marker (comment) will be inserted
at the current position. If you want to prevent a component or a procedure from
being affected by error handling insertion or removal operations then you should
insert the Skip modifier.
If a component has a modifier marker then all the procedures it contains that
do not have a modifier of their own and are not included in an error
handling scheme assignment will inherit the scheme specified by that marker.
For the above picture in the Form_Load event
procedure the ErrReport scheme will be used because this error handling
scheme has been specified using a modifier at the component level.
To remove the error handling scheme modifier for a component or a procedure
delete the special marker manually.
Notes
-
A component or a procedure can have only one error handling scheme modifier.
-
For property procedures with multiple instances (e.g. Let and Get) if a modifier
is present then the specified error handling scheme will be used for all instances.
See also
Back To Top
|