MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
WindowsError.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/Error.h"
16
18{
19 using namespace Mcro::Error;
20
21 /** @brief An error wrapping the returned code of GetLastError and attempts to get a string description of it */
22 MCROWINDOWS_API class FLastError : public IError
23 {
24 public:
25 FLastError(int32 errorCode);
26
27 /** @brief The result code wrapped by this error */
28 int32 ErrorCode;
29
30 /** @brief The message what the Windows API communicates to us */
32 };
33
34 /**
35 * @brief
36 * An error wrapping HRESULT code returned by many Microsoft APIs. It will also collect human readable metadata.
37 */
38 MCROWINDOWS_API class FHresultError : public IError
39 {
40 public:
41 /**
42 * @param result The input HRESULT
43 *
44 * @param fastMode
45 * Set it true to not gather human readable information about the error and just display the HRESULT code as is.
46 * Use it only in cursed situations where something may fail very often but it still needs a full IError
47 * somehow. Or just avoid such cursed situations in the first place.
48 */
49 FHresultError(HRESULT result, bool fastMode = false);
50
52
53 /** @brief The result code wrapped by this error */
54 HRESULT Result;
55
56 /** @brief The message what the Windows API communicates to us */
58
59 /**
60 * @brief
61 * Stores the language-dependent programmatic ID (ProgID) for the class or application that raised the error.
62 */
63 FString ProgramID;
64
65 /** @brief A textual description of the error (might be different from Message) */
66 FString Description;
67 };
68}
A base class for a structured error handling and reporting with modular architecture and fluent API.
Definition Error.h:68
An error wrapping HRESULT code returned by many Microsoft APIs. It will also collect human readable m...
FString Description
A textual description of the error (might be different from Message)
FHresultError(HRESULT result, bool fastMode=false)
FString SystemMessage
The message what the Windows API communicates to us.
HRESULT Result
The result code wrapped by this error.
FString ProgramID
Stores the language-dependent programmatic ID (ProgID) for the class or application that raised the e...
An error wrapping the returned code of GetLastError and attempts to get a string description of it.
int32 ErrorCode
The result code wrapped by this error.
FString SystemMessage
The message what the Windows API communicates to us.
Contains utilities for structured error handling.
Definition Error.Fwd.h:19