IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
error_codes.hxx
Go to the documentation of this file.
1
3
4#pragma once
5#include <ice/error.hxx>
6
7namespace ice
8{
9
10 static constexpr ice::ErrorCodeSuccess S_Ok{ "S.0000:General:Success" };
12
13 static constexpr ice::ErrorCodeError E_Fail{ "E.0001:General:Unknown error" };
15
16 static constexpr ice::ErrorCode E_InvalidArgument{ "E.0002:General:Invalid argument provided" };
17 static constexpr ice::ErrorCode E_OutOfRange{ "E.0003:General:Accessing value out of range" };
18 static constexpr ice::ErrorCode E_NotImplemented{ "E.0004:General:Function or method is not implemented" };
19 static constexpr ice::ErrorCode E_NullPointer{ "E.0005:General:Passed '{nullptr}' to function expecting valid pointer." };
20 static constexpr ice::ErrorCode E_NullPointerData{ "E.0006:General:Passed 'Data{nullptr}' object to function expecting valid data." };
21 static constexpr ice::ErrorCode E_NullPointerMemory{ "E.0007:General:Passed 'Memory{nullptr}' object to function expecting valid memory." };
22 static constexpr ice::ErrorCode E_TaskCanceled{ "E.1001:Tasks:Task canceled" };
23
24 // Aliases are comparable
25 static_assert(S_Ok == S_Success);
26 static_assert(E_Fail == E_Error);
27
28 // Success is not an error
29 static_assert(S_Success != E_Error);
30
31 // Generic Error comparable with specific error but not vice versa.
32 static_assert(E_Error == E_InvalidArgument);
33 static_assert(E_TaskCanceled != E_InvalidArgument);
34
35} // namespace ice
SPDX-License-Identifier: MIT.
Definition array.hxx:12
static constexpr ice::ErrorCodeError E_Fail
Definition error_codes.hxx:13
static constexpr ice::ErrorCode E_NullPointerData
Definition error_codes.hxx:20
static constexpr ice::ErrorCode E_TaskCanceled
Definition error_codes.hxx:22
static constexpr ice::ErrorCode E_InvalidArgument
Definition error_codes.hxx:16
static constexpr ice::ErrorCodeError E_Error
Definition error_codes.hxx:14
static constexpr ice::ErrorCode E_OutOfRange
Definition error_codes.hxx:17
static constexpr ice::ErrorCodeSuccess S_Success
Definition error_codes.hxx:11
static constexpr ice::ErrorCodeSuccess S_Ok
Definition error_codes.hxx:10
static constexpr ice::ErrorCode E_NullPointerMemory
Definition error_codes.hxx:21
static constexpr ice::ErrorCode E_NotImplemented
Definition error_codes.hxx:18
static constexpr ice::ErrorCode E_NullPointer
Definition error_codes.hxx:19
Definition error.hxx:99
Definition error.hxx:19
Definition error.hxx:91