CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Static Private Member Functions | List of all members
CYB::Exception::Internal Class Reference

Exceptions that are thrown internally in the engine that the should never see, these are a superset of SystemData type exceptions. If one of these exceptions appear in a unit, please contant the engine development team. More...

#include <Exception.hpp>

Inheritance diagram for CYB::Exception::Internal:
Inheritance graph
[legend]
Collaboration diagram for CYB::Exception::Internal:
Collaboration graph
[legend]

Public Types

enum  ErrorCode : unsigned int {
  MEMORY_COMMITAL_FAILURE, MEMORY_PROTECT_FAILURE, MEMORY_RESERVATION_FAILURE, MODULE_FUNCTION_LOAD_FAILURE,
  MODULE_LOAD_FAILURE, PATH_EVALUATION_FAILURE, PROCESS_CREATION_ERROR, PROCESS_EXIT_CODE_UNCHECKABLE,
  PROCESS_TERMINATION_ERROR
}
 The error code of the exception. More...
 
- Public Types inherited from CYB::Exception::Base
enum  Level : byte { Level::VIOLATION, Level::SYSTEM_DATA, Level::INTERNAL, Level::UNIT }
 The extended type of the exception. More...
 

Public Member Functions

 Internal (const ErrorCode AErrorCode) noexcept
 Construct an Internal exception. More...
 

Static Private Member Functions

static API::String::Static ErrorMessage (const ErrorCode AErrorCode) noexcept
 Get the associated message for an exception. More...
 

Additional Inherited Members

- Public Attributes inherited from CYB::Exception::Base
API::String::Static FMessage
 An english description of the error, guaranteed to be compatible with CYB::API::String::UTF8.
 
const unsigned int FErrorCode
 The assigned error code.
 
const Level FLevel
 The type of the exception.
 
- Protected Member Functions inherited from CYB::Exception::Base
 Base (API::String::Static &&AMessage, const unsigned int AErrorCode, const Level ALevel) noexcept
 Construct a Base exception. More...
 

Detailed Description

Exceptions that are thrown internally in the engine that the should never see, these are a superset of SystemData type exceptions. If one of these exceptions appear in a unit, please contant the engine development team.

Definition at line 104 of file Exception.hpp.

Member Enumeration Documentation

The error code of the exception.

Enumerator
MEMORY_COMMITAL_FAILURE 

Memory could not be commited from a reservation.

MEMORY_PROTECT_FAILURE 

Memory protection could not be set.

MEMORY_RESERVATION_FAILURE 

Memory could not be reserved.

MODULE_FUNCTION_LOAD_FAILURE 

Specific could not be loaded from given Module.

MODULE_LOAD_FAILURE 

Module could not be loaded.

PATH_EVALUATION_FAILURE 

Failed to evaluate a Path.

PROCESS_CREATION_ERROR 

Process could not be created for unknown reasons.

PROCESS_EXIT_CODE_UNCHECKABLE 

Tried to check the error code of a Process the OS would not allow.

PROCESS_TERMINATION_ERROR 

Process could not be terminated, most likely due to insufficient priviledges.

Definition at line 107 of file Exception.hpp.

107  : unsigned int {
117  };
Specific could not be loaded from given Module.
Definition: Exception.hpp:111
Memory protection could not be set.
Definition: Exception.hpp:109
Tried to check the error code of a Process the OS would not allow.
Definition: Exception.hpp:115
Process could not be terminated, most likely due to insufficient priviledges.
Definition: Exception.hpp:116
Memory could not be commited from a reservation.
Definition: Exception.hpp:108
Process could not be created for unknown reasons.
Definition: Exception.hpp:114

Constructor & Destructor Documentation

CYB::Exception::Internal::Internal ( const ErrorCode  AErrorCode)
noexcept

Construct an Internal exception.

Parameters
AErrorCodeThe ErrorCode describing the exception
Thread Safety
This function requires no thread safety
Exceptions
CYB::Exception::ViolationError code: CYB::Exception::Violation::INVALID_EXCEPTION_CODE. Thrown if AErrorCode is not recognized by the engine
Attention
This function is for internal use only

Definition at line 126 of file CYBException.cpp.

126  :
127  Base(ErrorMessage(AErrorCode), AErrorCode, Level::INTERNAL)
128 {
129  FLastInstantiatedExceptionCode = AErrorCode;
130 }
thread_local unsigned int FLastInstantiatedExceptionCode
Used to better verify tests, should be optimized out by the linker. See: http://stackoverflow.com/questions/1229430/how-do-i-prevent-my-unused-global-variables-being-compiled-out.
Definition: CYBException.cpp:7
static API::String::Static ErrorMessage(const ErrorCode AErrorCode) noexcept
Get the associated message for an exception.
Base(API::String::Static &&AMessage, const unsigned int AErrorCode, const Level ALevel) noexcept
Construct a Base exception.

Member Function Documentation

CYB::API::String::Static CYB::Exception::Internal::ErrorMessage ( const ErrorCode  AErrorCode)
staticprivatenoexcept

Get the associated message for an exception.

Parameters
AErrorCodeThe ErrorCode describing the exception
Returns
A description of the exception indicated by AErrorCode
Thread Safety
This function requires no thread safety

Definition at line 91 of file CYBException.cpp.

91  {
93  API::String::Static ErrorMessage;
94  switch (AErrorCode) {
96  ErrorMessage = API::String::Static(u8"Failed to commit virtual memory from the OS.");
97  break;
99  ErrorMessage = API::String::Static(u8"Failed to implement requested virtual memory protection level.");
100  break;
102  ErrorMessage = API::String::Static(u8"Failed to reserve virtual memory from the OS.");
103  break;
105  ErrorMessage = API::String::Static(u8"Failed to load a requested function from a module.");
106  break;
107  case MODULE_LOAD_FAILURE:
108  ErrorMessage = API::String::Static(u8"Failed to load a requested module.");
109  break;
111  ErrorMessage = API::String::Static(u8"Failed to evaluate a Path.");
112  break;
114  ErrorMessage = API::String::Static(u8"Failed to create Process for unknown reasons.");
115  break;
117  ErrorMessage = API::String::Static(u8"Tried to check the error code of a Process the OS would not allow.");
118  break;
120  ErrorMessage = API::String::Static(u8"Failed to terminate process, most likely due to insufficient permissions.");
121  break;
122  };
123  return ErrorMessage;
124 }
Specific could not be loaded from given Module.
Definition: Exception.hpp:111
Memory protection could not be set.
Definition: Exception.hpp:109
static API::String::Static ErrorMessage(const ErrorCode AErrorCode) noexcept
Get the associated message for an exception.
Tried to check the error code of a Process the OS would not allow.
Definition: Exception.hpp:115
Process could not be terminated, most likely due to insufficient priviledges.
Definition: Exception.hpp:116
Memory could not be commited from a reservation.
Definition: Exception.hpp:108
static void LessThanOrEqual(const AType &ALHS, const AType &ARHS) noexcept
Less than or equal assertion function. May not be evaluated.
Process could not be created for unknown reasons.
Definition: Exception.hpp:114

The documentation for this class was generated from the following files: