MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Error.Fwd.h
Go to the documentation of this file.
1
/** @noop License Comment
2
* @file
3
* @copyright
4
* This Source Code is subject to the terms of the Mozilla Public License, v2.0.
5
* If a copy of the MPL was not distributed with this file You can obtain one at
6
* https://mozilla.org/MPL/2.0/
7
*
8
* @author David Mórász
9
* @date 2025
10
*/
11
12
#pragma once
13
14
#include "CoreMinimal.h"
15
#include "
Mcro/Concepts.h
"
16
17
/** Contains utilities for structured error handling */
18
namespace
Mcro::Error
19
{
20
using namespace
Mcro::Concepts
;
21
22
class
IError
;
23
class
SErrorDisplay
;
24
25
using
IErrorRef
= TSharedRef<IError>;
/**< Convenience alias for an instance of an error */
26
using
IErrorPtr
= TSharedPtr<IError>;
/**< Convenience alias for an instance of an error */
27
using
IErrorWeakPtr
= TWeakPtr<IError>;
/**< Convenience alias for an instance of an error */
28
29
using
FNamedError
= TPair<FString, IErrorRef>;
30
31
/** Concept constraining input type argument T to an IError */
32
template
<
typename
T>
33
concept
CError
= CDerivedFrom<T, IError>;
34
35
/** Concept constraining input type argument T to be an IErrorRef */
36
template
<
typename
T>
37
concept
CErrorRef
= CSharedRef<T> &&
CError<typename T::ElementType>
;
38
39
/** Concept constraining input type argument T to be an IErrorPtr */
40
template
<
typename
T>
41
concept
CErrorPtr
= CSharedPtr<T> &&
CError<typename T::ElementType>
;
42
43
/** Concept constraining input type argument T to be an IErrorPtr */
44
template
<
typename
T>
45
concept
CErrorRefOrPtr
=
CErrorRef<T>
||
CErrorPtr<T>
;
46
47
/** Concept constraining input type argument T to be an IErrorPtr */
48
template
<
typename
T>
49
concept
CSharedError
=
CErrorRefOrPtr<T>
|| (CWeakPtr<T> &&
CError<typename T::ElementType>
);
50
51
/** Indicate the severity of an error and at what discretion the caller may treat it. */
52
enum class
EErrorSeverity
53
{
54
/** Indicates that an inner error just contains extra context for a real error */
55
ErrorComponent
= -1,
56
57
/** The caller can handle the error and may continue execution, for example errors with telemetry. */
58
Recoverable
,
59
60
/**
61
* A sub-program (like PIE) or a thread should abort its entire purpose but it should not crash the entire
62
* encompassing application, for example early runtime checks about the correctness of some required configuration.
63
*/
64
Fatal
,
65
66
/**
67
* The application has arrived to an invalid state from which recovery is impossible, for example access
68
* violation errors.
69
*/
70
Crashing
71
};
72
}
Concepts.h
Mcro::Error::IError
Definition
Error.h:64
Mcro::Error::SErrorDisplay
Definition
SErrorDisplay.h:25
Mcro::Error::CErrorPtr
Definition
Error.Fwd.h:41
Mcro::Error::CErrorRefOrPtr
Definition
Error.Fwd.h:45
Mcro::Error::CErrorRef
Definition
Error.Fwd.h:37
Mcro::Error::CError
Definition
Error.Fwd.h:33
Mcro::Error::CSharedError
Definition
Error.Fwd.h:49
Mcro::Concepts
Definition
Concepts.h:34
Mcro::Error
Definition
Error.Fwd.h:19
Mcro::Error::IErrorRef
TSharedRef< IError > IErrorRef
Definition
Error.Fwd.h:25
Mcro::Error::IErrorWeakPtr
TWeakPtr< IError > IErrorWeakPtr
Definition
Error.Fwd.h:27
Mcro::Error::FNamedError
TPair< FString, IErrorRef > FNamedError
Definition
Error.Fwd.h:29
Mcro::Error::IErrorPtr
TSharedPtr< IError > IErrorPtr
Definition
Error.Fwd.h:26
Mcro::Error::EErrorSeverity
EErrorSeverity
Definition
Error.Fwd.h:53
Mcro::Error::EErrorSeverity::Recoverable
@ Recoverable
Mcro::Error::EErrorSeverity::Fatal
@ Fatal
Mcro::Error::EErrorSeverity::ErrorComponent
@ ErrorComponent
Mcro::Error::EErrorSeverity::Crashing
@ Crashing
Mcro_Origin
Public
Mcro
Error.Fwd.h
Generated by
1.12.0