![]() |
MCRO
C++23 utilities for Unreal Engine.
|
An Error component which stores a BP stack trace in its message upon construction. More...
#include <BlueprintStackTrace.h>
Public Member Functions | |
| FBlueprintStackTrace () | |
Public Member Functions inherited from Mcro::Error::IError | |
| FORCEINLINE decltype(InnerErrors) ::TRangedForIterator | begin () |
| FORCEINLINE decltype(InnerErrors) ::TRangedForConstIterator | begin () const |
| FORCEINLINE decltype(InnerErrors) ::TRangedForIterator | end () |
| FORCEINLINE decltype(InnerErrors) ::TRangedForConstIterator | end () const |
| void | Initialize () |
| This is an empty function so any IError can fulfill CSharedInitializeable without needing extra attention in derived classes. Simply hide this function with overloads in derived classes if they need to use TSharedFromThis for initialization. | |
| FString | ToString () const |
| Render this error as a string using the YAML representation. | |
| std::string | ToStringUtf8 () const |
| Render this error as a std::string using the YAML representation. | |
| FORCEINLINE EErrorSeverity | GetSeverity () const |
| FORCEINLINE int32 | GetSeverityInt () const |
| FORCEINLINE FString const & | GetMessage () const |
| FORCEINLINE FString const & | GetDetails () const |
| FORCEINLINE FString const & | GetCodeContext () const |
| FORCEINLINE TMap< FString, IErrorRef > const & | GetInnerErrors () const |
| FORCEINLINE int32 | GetInnerErrorCount () const |
| TArray< FString > | GetErrorPropagation () const |
| Get a list of source locations where this error has been handled. This is not equivalent of stack-traces but rather a historical record of where this error was considered throughout the source code. Each item in this list is explicitly recorded via WithLocation. The first item is the earliest consideration of this error. | |
| FString | GetErrorPropagationJoined () const |
Same as GetErrorPropagation but items are separated by new line. | |
| FStringView | GetSeverityString () const |
| Get the error severity as an unreal string. | |
| template<typename Self > | |
| SelfRef< Self > | WithMessage (this Self &&self, const FString &input, bool condition=true) |
| Specify error message with a fluent API. | |
| template<typename Self , CStringFormatArgument... FormatArgs> | |
| SelfRef< Self > | WithMessageF (this Self &&self, const TCHAR *input, FormatArgs &&... fmtArgs) |
| Specify formatted error message with a fluent API. | |
| template<typename Self , typename... FormatArgs> | |
| SelfRef< Self > | WithMessageFC (this Self &&self, bool condition, const TCHAR *input, FormatArgs &&... fmtArgs) |
| Specify formatted error message with a fluent API. | |
| template<typename Self > | |
| SelfRef< Self > | WithSeverity (this Self &&self, EErrorSeverity input) |
| Specify severity with a fluent API. | |
| template<typename Self > | |
| SelfRef< Self > | AsRecoverable (this Self &&self) |
| Recoverable shorthand. | |
| template<typename Self > | |
| SelfRef< Self > | AsFatal (this Self &&self) |
| Fatal shorthand. | |
| template<typename Self > | |
| SelfRef< Self > | AsCrashing (this Self &&self) |
| Crashing shorthand. | |
| template<typename Self > | |
| SelfRef< Self > | WithDetails (this Self &&self, const FString &input, bool condition=true) |
| Specify details for the error which may provide further context for the user or provide them reminders/suggestions. | |
| template<typename Self , CStringFormatArgument... FormatArgs> | |
| SelfRef< Self > | WithDetailsF (this Self &&self, const TCHAR *input, FormatArgs &&... fmtArgs) |
| Specify formatted details for the error which may provide further context for the user or provide them reminders/suggestions. | |
| template<typename Self , CStringFormatArgument... FormatArgs> | |
| SelfRef< Self > | WithDetailsFC (this Self &&self, bool condition, const TCHAR *input, FormatArgs &&... fmtArgs) |
| Specify formatted details for the error which may provide further context for the user or provide them reminders/suggestions. | |
| template<typename Self > | |
| SelfRef< Self > | WithCodeContext (this Self &&self, const FString &input, bool condition=true) |
| If available write a source code context into the error directly displaying where this error has occured. | |
| template<typename Self , CError Error> | |
| SelfRef< Self > | WithError (this Self &&self, const TSharedRef< Error > &input, bool condition=true) |
| Add a uniquely typed inner error. | |
| template<typename Self , CError Error> | |
| SelfRef< Self > | WithError (this Self &&self, const FString &name, const TSharedRef< Error > &input, bool condition=true) |
| Add one inner error with specific name. | |
| template<typename Self > | |
| SelfRef< Self > | WithErrors (this Self &&self, const TArray< TTuple< FString, IErrorRef > > &input, bool condition=true) |
| Add multiple errors at once with optional names. | |
| template<typename Self , CError... Errors> | |
| SelfRef< Self > | WithErrors (this Self &&self, const TSharedRef< Errors > &... errors) |
| Add multiple errors at once. | |
| template<typename Self , CError... Errors> | |
| SelfRef< Self > | WithErrors (this Self &&self, bool condition, const TSharedRef< Errors > &... errors) |
| Add multiple errors at once. | |
| template<typename Self > | |
| SelfRef< Self > | WithAppendix (this Self &&self, const FString &name, const FString &text, bool condition=true) |
| Add an extra plain text block inside inner errors. | |
| template<typename Self , CStringFormatArgument... FormatArgs> | |
| SelfRef< Self > | WithAppendixF (this Self &&self, const FString &name, const TCHAR *text, FormatArgs &&... fmtArgs) |
| Add an extra plain text block inside inner errors. | |
| template<typename Self , CStringFormatArgument... FormatArgs> | |
| SelfRef< Self > | WithAppendixFC (this Self &&self, bool condition, const FString &name, const TCHAR *text, FormatArgs &&... fmtArgs) |
| Add an extra plain text block inside inner errors. | |
| template<typename Self > | |
| SelfRef< Self > | Notify (this Self &&self, Observable::IState< IErrorPtr > &state) |
| Notify an observable state about this error. | |
| template<typename Self > | |
| SelfRef< Self > | BreakDebugger (this Self &&self) |
| Break if a debugger is attached when this error is created. | |
| template<typename Self > | |
| SelfRef< Self > | WithCppStackTrace (this Self &&self, const FString &name={}, bool condition=true, int32 numAdditionalStackFramesToIgnore=0, bool fastWalk=!UE_BUILD_DEBUG) |
| Shorthand for adding the current C++ stacktrace to this error. | |
| template<typename Self > | |
| SelfRef< Self > | WithBlueprintStackTrace (this Self &&self, const FString &name={}, bool condition=true) |
| Shorthand for adding the current Blueprint stacktrace to this error. | |
| template<typename Self > | |
| SelfRef< Self > | WithLocation (this Self &&self, std::source_location const &location=std::source_location::current()) |
| Allow the error to record the source locations it has been handled at compile time. For example this gives more information than stack-traces because it can also record where errors were handled between parallel threads. | |
| template<typename Self > | |
| SelfRef< Self > | Report (this Self &&self, bool condition=true) |
Report this error to the global IError::OnErrorReported event once it is deemed "ready", so an issue tracking system can handle important error unintrusively. Make sure this is the last modification on the error. Only call it once no further information can be added and on the top-most main error in case of aggregate errors. | |
| template<typename Self , CFunctionCompatible_ArgumentsDecay< void(SelfRef< Self >)> Function> | |
| SelfRef< Self > | AsOperandWith (this Self &&self, Function &&function) |
| Call an arbitrary function with this error. Other than cases like invoking macros inline operating on errors (like the inline ERROR_LOG overload) this may have limited use. | |
Public Member Functions inherited from Mcro::Types::IHaveType | |
| virtual | ~IHaveType ()=default |
| template<CSharedFromThis Self> | |
| SelfRef< Self > | WithType (this Self &&self) |
| Fluent API for setting tpye for deferred initialization (for example in factory functions) | |
| template<typename Self > requires (!CSharedFromThis<Self>) | |
| Self && | WithType (this Self &&self) |
| Fluent API for setting tpye for deferred initialization (for example in factory functions) | |
| FORCEINLINE FType const & | GetType () const |
| FORCEINLINE FName const & | GetTypeFName () const |
| FORCEINLINE FString | GetTypeString () const |
| template<typename Derived , CSharedFromThis Self> | |
| TSharedPtr< Derived > | As (this Self &&self) |
Dynamic casting of this object to a derived top-level type. Casting also works if inheritance is done through TInherit template. | |
| template<typename Derived , typename Self > requires (!CSharedFromThis<Self>) | |
| Derived * | As (this Self &&self) |
Dynamic casting of this object to a derived top-level type. Casting also works if inheritance is done through TInherit template. | |
Additional Inherited Members | |
Public Types inherited from Mcro::Types::IHaveType | |
| template<typename Self > | |
| using | SelfRef = TSharedRef<std::decay_t<Self>> |
Static Public Member Functions inherited from Mcro::Error::IError | |
| template<CError T, typename... Args> requires CSharedInitializeable<T, Args...> | |
| static TSharedRef< T > | Make (T *newError, Args &&... args) |
| To ensure automatic type reflection use IError::Make instead of manually constructing error objects. | |
| static auto | OnErrorReported () -> TEventDelegate< void(IErrorRef)> & |
When Report is called on an error this event is triggered, allowing issue tracking systems to react on IError's which are deemed "ready". | |
Protected Member Functions inherited from Mcro::Error::IPlainTextComponent | |
| virtual void | AddError (const FString &name, const TSharedRef< IError > &error, const FString &typeOverride={}) override |
| Override this method if inner errors added to current one needs special attention. | |
| virtual void | SerializeInnerErrors (YAML::Emitter &) const override |
| Override this method if inner errors needs custom way of serialization. | |
| virtual void | SerializeYaml (YAML::Emitter &emitter) const override |
| Override this function to change the method how this error is entirely serialized into a YAML format. | |
| virtual TSharedRef< SErrorDisplay > | CreateErrorWidget () override |
| Override this function to customize how an error is displaxed for the end-user. | |
Protected Member Functions inherited from Mcro::Error::IError | |
| virtual void | SerializeErrorPropagation (YAML::Emitter &emitter) const |
| Override this method if error propagation history needs custom way of serialization. | |
| virtual void | AddAppendix (const FString &name, const FString &text, const FString &type=TEXT_"Appendix") |
| Add extra separate blocks of text in an ad-hoc fashion. | |
| void | AddCppStackTrace (const FString &name, int32 numAdditionalStackFramesToIgnore, bool fastWalk) |
| void | AddBlueprintStackTrace (const FString &name) |
| virtual void | SerializeMembers (YAML::Emitter &emitter) const |
| Override this method if direct members should be serialized differently or extra members are added by derived errors. | |
| virtual void | NotifyState (Observable::IState< IErrorPtr > &state) |
Protected Member Functions inherited from Mcro::Types::IHaveType | |
| template<typename Self > | |
| void | SetType (this Self &&self) |
| This function needs to be called on top level derived type for runtime reflection to work. | |
Protected Attributes inherited from Mcro::Error::IError | |
| TMap< FString, IErrorRef > | InnerErrors |
| TArray< std::source_location > | ErrorPropagation |
| EErrorSeverity | Severity = EErrorSeverity::ErrorComponent |
| FString | Message |
| FString | Details |
| FString | CodeContext |
| bool | bIsRoot = false |
Protected Attributes inherited from Mcro::Types::IHaveType | |
| FName | TypeName |
| FType | TypeInfo |
An Error component which stores a BP stack trace in its message upon construction.
Definition at line 22 of file BlueprintStackTrace.h.
| Mcro::Error::FBlueprintStackTrace::FBlueprintStackTrace | ( | ) |