UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMRuntimeError.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
8#define UE_API COREUOBJECT_API
9
11
12namespace Verse
13{
14// NOTE: (yiliang.siew) Right now, these are all errors, but in the future there could be warnings potentially.
15#define VERSE_RUNTIME_GLITCH_ENUM_DIAGNOSTICS(v) \
16 v(UnrecoverableError, ErrRuntime_Internal, "An internal runtime error occurred. There is no other information available.") \
17 v(UnrecoverableError, ErrRuntime_TransactionAbortedByLanguage, "An internal transactional runtime error occurred. There is no other information available.") \
18 v(UnrecoverableError, ErrRuntime_NativeInternal, "An internal runtime error occurred in native code that was called from Verse. There is no other information available.") \
19 v(UnrecoverableError, ErrRuntime_GeneratedNativeInternal, "An internal runtime error occurred in (generated) native code that was called from Verse. There is no other information available.") \
20 v(UnrecoverableError, ErrRuntime_InfiniteLoop, "The runtime terminated prematurely because Verse code was running in an infinite loop.") \
21 v(UnrecoverableError, ErrRuntime_ComputationLimitExceeded, "The runtime terminated prematurely because Verse code took too long to execute within a single server tick. Try offloading heavy computation to async contexts.") \
22 v(UnrecoverableError, ErrRuntime_Overflow, "Overflow encountered.") \
23 v(UnrecoverableError, ErrRuntime_Underflow, "Underflow encountered.") \
24 v(UnrecoverableError, ErrRuntime_FloatingPointOverflow, "Floating-point overflow encountered.") \
25 v(UnrecoverableError, ErrRuntime_IntegerOverflow, "Integer overflow encountered.") \
26 v(UnrecoverableError, ErrRuntime_ErrorRequested, "A runtime error was explicitly raised from user code.") \
27 v(UnrecoverableError, ErrRuntime_IntegerBoundsExceeded, "A value does not fall inside the representable range of a Verse integer.") \
28 v(UnrecoverableError, ErrRuntime_MemoryLimitExceeded, "Exceeded memory limit(s).") \
29 v(UnrecoverableError, ErrRuntime_DivisionByZero, "Division by zero attempted.") \
30 v(UnrecoverableError, ErrRuntime_WeakMapInvalidKey, "Invalid key used to access persistent `var` `weak_map`.") \
31 v(UnrecoverableError, ErrRuntime_InvalidVarRead, "Attempted to read a `var` out of an invalid object.") \
32 v(UnrecoverableError, ErrRuntime_InvalidVarWrite, "Attempted to write to a `var` of an invalid object.") \
33 v(UnrecoverableError, ErrRuntime_InvalidFunctionCall, "Attempted to call an invalid function.") \
34 v(UnrecoverableError, ErrRuntime_MathIntrinsicCallFailure, "A math intrinsic failed.") \
35 v(UnrecoverableError, ErrRuntime_InvalidArrayLength, "Invalid array length.") \
36 v(UnrecoverableError, ErrRuntime_InvalidStringLength, "Invalid string length.") \
37 v(UnrecoverableError, ErrRuntime_InvalidLeaderboard, "Leaderboard failed to compile and cannot be instantiated.") \
38 v(UnrecoverableError, ErrRuntime_FailedToRegisterLeaderboard, "Leaderboard could not be registered with the back end.") \
39 v(UnrecoverableError, ErrRuntime_UnregisteredLeaderboard, "Trying to interact with an unregistered Leaderboard.")
40
42{
43#define VISIT_DIAGNOSTIC(Severity, EnumName, Description) EnumName,
45#undef VISIT_DIAGNOSTIC
46};
47
52
59
61
62UE_API FString AsFormattedString(const ERuntimeDiagnostic& Diagnostic, const FText& MessageText);
63
65} // namespace Verse
66
69
79
80// Mechanism for raising a Verse runtime error.
81#define RAISE_VERSE_RUNTIME_ERROR_CODE(Diagnostic) \
82 do \
83 { \
84 const ::Verse::SRuntimeDiagnosticInfo& DiagnosticInfo = GetRuntimeDiagnosticInfo(Diagnostic); \
85 ::Verse::RaiseVerseRuntimeError(Diagnostic, FText::FromString(DiagnosticInfo.Description)); \
86 } \
87 while (0)
88
89#define RAISE_VERSE_RUNTIME_ERROR(Diagnostic, Message) \
90 do \
91 { \
92 const FText MessageAsText(FText::FromString(Message)); \
93 ::Verse::RaiseVerseRuntimeError(Diagnostic, MessageAsText); \
94 } \
95 while (0)
96
97#define RAISE_VERSE_RUNTIME_ERROR_FORMAT(Diagnostic, FormatString, ...) \
98 do \
99 { \
100 const FText MessageAsText(FText::FromString(FString::Printf(FormatString, ##__VA_ARGS__))); \
101 ::Verse::RaiseVerseRuntimeError(Diagnostic, MessageAsText); \
102 } \
103 while (0)
104
105#define RETURN_RAISE_VERSE_RUNTIME_ERROR_UNLESS(Cond, ErrCode, ErrStr, ...) \
106 do \
107 { \
108 if (!(Cond)) \
109 { \
110 RAISE_VERSE_RUNTIME_ERROR_FORMAT(::Verse::ERuntimeDiagnostic::ErrCode, ErrStr, ##__VA_ARGS__); \
111 return; \
112 } \
113 } \
114 while (false)
115
116#undef UE_API
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define UE_API
Definition SColorGradingComponentViewer.h:12
#define UE_API
Definition VVMRuntimeError.h:8
#define VERSE_RUNTIME_GLITCH_ENUM_DIAGNOSTICS(v)
Definition VVMRuntimeError.h:15
Definition Text.h:385
Definition VVMRuntimeError.h:71
static UE_API FVerseUnwindRuntimeErrorHandler OnUnwindRuntimeError
Definition VVMRuntimeError.h:74
static UE_API FVerseRuntimeErrorReportHandler OnVerseRuntimeError
Definition VVMRuntimeError.h:77
Definition Archive.h:36
ERuntimeDiagnostic
Definition VVMRuntimeError.h:42
VISIT_DIAGNOSTIC(Severity, EnumName, Description)
const SRuntimeDiagnosticInfo & GetRuntimeDiagnosticInfo(const ERuntimeDiagnostic Diagnostic)
Definition VVMRuntimeError.cpp:25
ERuntimeDiagnosticSeverity
Definition VVMRuntimeError.h:49
FString AsFormattedString(const ERuntimeDiagnostic &Diagnostic, const FText &MessageText)
Definition VVMRuntimeError.cpp:35
void RaiseVerseRuntimeError(const Verse::ERuntimeDiagnostic Diagnostic, const FText &MessageText)
Definition VVMRuntimeError.cpp:130
Definition VVMRuntimeError.h:54
const char * Description
Definition VVMRuntimeError.h:56
const char * Name
Definition VVMRuntimeError.h:55
ERuntimeDiagnosticSeverity Severity
Definition VVMRuntimeError.h:57