UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModSourceFailure.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric Contributors
3#pragma once
4
5#include <span>
6
7namespace Mod::ExportMetadata
8{
11{
12public:
16 EXPORTMETADATA_API explicit FSourceFailureScope(std::span<const unsigned int> DeclaredCodes) noexcept;
17
19 EXPORTMETADATA_API ~FSourceFailureScope();
20
25
27 EXPORTMETADATA_API static void Record(unsigned int Code) noexcept;
28
32 unsigned int GetError() const noexcept
33 {
34 return Error;
35 }
36
37private:
38 FSourceFailureScope* Previous;
39 std::span<const unsigned int> Codes;
40 unsigned int Error = 0;
41};
42} // namespace Mod::ExportMetadata
Captures the source errors declared by one generated native call.
Definition ModSourceFailure.h:11
FSourceFailureScope(const FSourceFailureScope &)=delete
Disallows copying the active capture.
EXPORTMETADATA_API FSourceFailureScope(std::span< const unsigned int > DeclaredCodes) noexcept
Begins capturing errors for a generated native call.
EXPORTMETADATA_API ~FSourceFailureScope()
Restores the previous failure capture on the calling thread.
static EXPORTMETADATA_API void Record(unsigned int Code) noexcept
Records an explicit source error for the active native invocation.
unsigned int GetError() const noexcept
Reads the business status recorded for this invocation.
Definition ModSourceFailure.h:32
FSourceFailureScope & operator=(const FSourceFailureScope &)=delete
Disallows replacing the active capture.