UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ErrorReporter.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3#include "ChaosLog.h"
4#include "Logging/LogMacros.h"
5
6namespace Chaos
7{
9{
10public:
12 : bEncountedErrors(false)
13 , bUnhandledErrors(false)
14 , Prefix(ErrorPrefix)
15 {
16 }
17
19 {
20 bUnhandledErrors = false;
21 }
22
24 {
25 return bUnhandledErrors;
26 }
27
28 void ReportLog(const TCHAR* ErrorMsg)
29 {
30 if(Prefix != "")
31 {
32 UE_LOG(LogChaos, Log, TEXT("ErrorReporter (%s): %s"), *Prefix, ErrorMsg);
33 }
34 else
35 {
36 UE_LOG(LogChaos, Log, TEXT("ErrorReporter: %s"), ErrorMsg);
37 }
38 }
39
40 void ReportWarning(const TCHAR* ErrorMsg)
41 {
42 if (Prefix != "")
43 {
44 UE_LOG(LogChaos, Warning, TEXT("ErrorReporter (%s): %s"), *Prefix, ErrorMsg);
45 }
46 else
47 {
48 UE_LOG(LogChaos, Warning, TEXT("ErrorReporter: %s"), ErrorMsg);
49 }
50 }
51
52 void ReportError(const TCHAR* ErrorMsg)
53 {
54 ReportWarning(ErrorMsg);
55 bEncountedErrors = true;
56 bUnhandledErrors = true;
57 }
58
60 {
61 return bEncountedErrors;
62 }
63
64 void SetPrefix(FString NewPrefix)
65 {
66 Prefix = NewPrefix;
67 }
68
69 FString GetPrefix()
70 {
71 return Prefix;
72 }
73
74private:
75 bool bEncountedErrors;
76 bool bUnhandledErrors;
77 FString Prefix;
78};
79}
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
Definition ErrorReporter.h:9
void ReportWarning(const TCHAR *ErrorMsg)
Definition ErrorReporter.h:40
void HandleLatestError()
Definition ErrorReporter.h:18
void SetPrefix(FString NewPrefix)
Definition ErrorReporter.h:64
void ReportLog(const TCHAR *ErrorMsg)
Definition ErrorReporter.h:28
bool ContainsUnhandledError() const
Definition ErrorReporter.h:23
FErrorReporter(FString ErrorPrefix="")
Definition ErrorReporter.h:11
bool EncounteredAnyErrors() const
Definition ErrorReporter.h:59
FString GetPrefix()
Definition ErrorReporter.h:69
void ReportError(const TCHAR *ErrorMsg)
Definition ErrorReporter.h:52
Definition SkeletalMeshComponent.h:307
@ false
Definition radaudio_common.h:23