MCRO
C++23 utilities for Unreal Engine.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
Mcro::Error Namespace Reference

Contains utilities for structured error handling. More...

Data Structures

class  FAssertion
 A simple error type for checking booleans. It adds no extra features to IError. More...
 
class  FBlueprintStackTrace
 An Error component which stores a BP stack trace in its message upon construction. More...
 
class  FCppException
 Unreal itself discourages the usage of C++ exceptions and there are also couple of thoughts above IError why that's the case. However, there are third-party libraries which may require their users to catch errors, their functions may, yield via exceptions. For this reason there's an IError wrapper around std::exception base class which however will not preserve the actual type of the caught exception. For that use TCppException template. More...
 
class  FCppStackTrace
 An Error component which stores a C++ stack trace in its message upon construction. More...
 
struct  FDisplayErrorArgs
 Control how an error is being displayed. Use C++ 20 designated initializers for convenience. More...
 
class  FErrorManager
 Global facilities for IError handling, including displaying them to the user, trigger error events, etc. More...
 
class  FUnavailable
 A simple error type denoting that whatever is being accessed is not available like attempting to access nullptr. It adds no extra features to IError. More...
 
class  IError
 A base class for a structured error handling and reporting with modular architecture and fluent API. More...
 
class  IErrorDisplayExtension
 A modular feature which allows other modules to inject their own UI into the common error display widget. More...
 
class  IErrorWindowExtension
 A modular feature which allows other modules to inject their own UI into error windows displayed to the user. More...
 
class  IPlainTextComponent
 An error component which displays only its Message, used as simple modular plain text storage. More...
 
class  SErrorDisplay
 Base class for displaying Mcro::Error::IError objects to the user. More...
 
class  SPlainTextDisplay
 Displaying error components which just provide a block of text (like a stack-trace) More...
 
class  TCppException
 Use this template for catching STL exceptions to preserve the exception type name. More...
 
struct  TMaybe
 A TValueOrError alternative for IError which allows implicit conversion from values and errors (no need for MakeError or MakeValue) and is boolean testable. It also doesn't have ambiguous state such as TValueOrError has, so a TMaybe will always have either an error or a value, it will never have neither of them or both of them. More...
 

Concepts

concept  CError
 Concept constraining input type argument T to an IError.
 
concept  CErrorRef
 Concept constraining input type argument T to be an IErrorRef.
 
concept  CErrorPtr
 Concept constraining input type argument T to be an IErrorPtr.
 
concept  CErrorRefOrPtr
 Concept constraining input type argument T to be an IErrorPtr.
 
concept  CSharedError
 Concept constraining input type argument T to be an IErrorPtr.
 

Typedefs

using IErrorRef = TSharedRef<IError>
 Convenience alias for an instance of an error.
 
using IErrorPtr = TSharedPtr<IError>
 Convenience alias for an instance of an error.
 
using IErrorWeakPtr = TWeakPtr<IError>
 Convenience alias for an instance of an error.
 
using FNamedError = TPair<FString, IErrorRef>
 
using FCanFail = TMaybe<FVoid>
 Indicate that an otherwise void function that it may fail with an IError.
 
using FTrueOrReason = TMaybe<FVoid>
 Syntactically same as FCanFail but for functions which is explicitly used to query some boolean decidable thing, and which can also provide a reason why the queried thing is false.
 

Enumerations

enum class  EErrorSeverity { ErrorComponent = -1 , Recoverable , Fatal , Crashing }
 Indicate the severity of an error and at what discretion the caller may treat it. More...
 

Functions

FORCEINLINE FCanFail Success ()
 Return an FCanFail or FTrueOrReason indicating a success or truthy output.
 

Detailed Description

Contains utilities for structured error handling.

Contains utilities for structured error handling

Typedef Documentation

◆ FCanFail

Indicate that an otherwise void function that it may fail with an IError.

Definition at line 632 of file Error.h.

◆ FNamedError

using Mcro::Error::FNamedError = TPair<FString, IErrorRef>

Definition at line 29 of file Error.Fwd.h.

◆ FTrueOrReason

Syntactically same as FCanFail but for functions which is explicitly used to query some boolean decidable thing, and which can also provide a reason why the queried thing is false.

Definition at line 639 of file Error.h.

◆ IErrorPtr

using Mcro::Error::IErrorPtr = TSharedPtr<IError>

Convenience alias for an instance of an error.

Definition at line 26 of file Error.Fwd.h.

◆ IErrorRef

using Mcro::Error::IErrorRef = TSharedRef<IError>

Convenience alias for an instance of an error.

Definition at line 25 of file Error.Fwd.h.

◆ IErrorWeakPtr

Convenience alias for an instance of an error.

Definition at line 27 of file Error.Fwd.h.

Enumeration Type Documentation

◆ EErrorSeverity

enum class Mcro::Error::EErrorSeverity
strong

Indicate the severity of an error and at what discretion the caller may treat it.

Enumerator
ErrorComponent -1 

Indicates that an inner error just contains extra context for a real error.

Recoverable  

The caller can handle the error and may continue execution, for example errors with telemetry.

Fatal  

A sub-program (like PIE) or a thread should abort its entire purpose but it should not crash the entire encompassing application, for example early runtime checks about the correctness of some required configuration.

Crashing  

The application has arrived to an invalid state from which recovery is impossible, for example access violation errors.

Definition at line 52 of file Error.Fwd.h.

Function Documentation

◆ Success()

FORCEINLINE FCanFail Mcro::Error::Success ( )

Return an FCanFail or FTrueOrReason indicating a success or truthy output.

Definition at line 642 of file Error.h.