System.Rtti.TInterceptExceptionNotify

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TInterceptExceptionNotify = reference to procedure(Instance: TObject;
Method: TRttiMethod; const Args: TArray<TValue>; out RaiseException: Boolean;
TheException: Exception; out Result: TValue);

C++

__interface TInterceptExceptionNotify  : public System::IInterface

Properties

Type Visibility Source Unit Parent
anonMethod
class
public
System.Rtti.pas
System.Rtti.hpp
System.Rtti System.Rtti

Description

This is the type of the System.Rtti.TVirtualMethodInterceptor.OnException event handler procedure.

Use TInterceptExceptionNotify to implement the OnException event handler to inhibit unwinding of the exception, so that the method appears to return normally.

Set RaiseException to False to inhibit unwinding and further propagation of the exception that occurred. The default value is True, which causes the exception to be reraised and propagated to the caller.

Args is the list of arguments passed to the virtual method, wrapped as values of TValue. In the case of var or out parameters, these values may be further modified with effect on the caller - values corresponding to parameters passed by value are discarded after this event is invoked. Note that any changes to var or out parameters may still have observable effects even if the exception is raised.

TheException is the exception object that was raised by the inherited method implementation.

Instance is the instance on which a virtual method was called.

Method is the RTTI object corresponding to the virtual method invoked on the instance.

In the case where RaiseException is set to False (so the propagation of the exception is suppressed), Result should be set to the desired return value of the method. Its default value is TValue.Empty, which will convert to 0, nil, '', or the corresponding empty value of the return type.

See Also