Navigation
API > API/Plugins > API/Plugins/ToolsetRegistry > API/Plugins/ToolsetRegistry/FToolCallExceptionHandler
Warnings * This is intended to be only used for testing tools derived from UToolsetDefinition.
Description
Call a function within a scope where it's possible to call UKismetSystemLibrary::RaiseScriptError() without dynamically calling a UFunction.
When tools are executed via FBlueprintLibraryToolset, a stack frame is configured and the appropriate method of a class derived from UToolsetDefinition is called. In test cases it is convenient to be able to call a toolset method directly from C++ but this does not result in the configuration of a Blueprints stack frame (FFrame) which results in UKismetSystemLibrary::RaiseScriptError() silently doing nothing.
This method calls the specified function within a scope that has a stack frame constructed on the calling thread such that calls to UKismetSystemLibrary::RaiseScriptError() within Func will notify this class of the errors.
This is intended to be only used for testing tools derived from UToolsetDefinition.
| Name | CaptureErrorsIn |
| Type | function |
| Header File | /Engine/Plugins/Experimental/ToolsetRegistry/Source/ToolsetRegistry/Public/ToolsetRegistry/ToolCallExceptionHandler.h |
| Include Path | #include "ToolsetRegistry/ToolCallExceptionHandler.h" |
| Source | /Engine/Plugins/Experimental/ToolsetRegistry/Source/ToolsetRegistry/Private/ToolsetRegistry/ToolCallExceptionHandler.cpp |
void CaptureErrorsIn
(
TFunction < void> && Func
)
Parameters
| Name | Remarks |
|---|---|
| Func | Function to call within a test scope. |