19 #ifndef PSYSTEM_EXCEPTION_BASE_SYSTEM_EXCEPTION_HPP
20 #define PSYSTEM_EXCEPTION_BASE_SYSTEM_EXCEPTION_HPP
41 #define THROW_WINDOWS_EXCEPTION(err, msg) \
43 throw psystem::exception::system_exception( \
44 __FILE__, __FUNCTION__, __LINE__, err, msg) ; \
59 #define THROW_WINDOWS_EXCEPTION_F(err, msg, ...) \
61 throw psystem::exception::system_exception( \
62 __FILE__, __FUNCTION__, __LINE__, err, msg, __VA_ARGS__) ; \
112 template <
typename... MessageArgs>
114 std::string
const& file,
115 std::string
const&
function,
120 file,
function, line,
std::forward<MessageArgs>(message)...),
175 #endif // PSYSTEM_EXCEPTION_BASE_SYSTEM_EXCEPTION_HPP
Definition: shared_handle.hpp:782
Base exception class from which all PSystem exceptions must inherit.
Definition: base_exception.hpp:73
Declares the root of the exception class hierarchy for PSystem.
An exception type to encapsulate errors presented by the system API.
Definition: system_exception.hpp:89
static std::string get_windows_error(DWORD error_code) noexcept
Given a Windows system error code, retrieve a textual description of the error.
Definition: system_exception.cpp:52
system_exception(std::string const &file, std::string const &function, uint32_t line, DWORD error_code, MessageArgs &&...message) noexcept
Construct an exception with a formatted description of the error.
Definition: system_exception.hpp:113
Declarations required for the psystem::exception namespace.
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
std::string const m_what
Definition: system_exception.hpp:169
DWORD const m_error_code
The Windows error code that caused this exception.
Definition: system_exception.hpp:166
std::string const & function() const noexcept
Return the function where the exception occurred.
Definition: base_exception.cpp:55
DWORD error_code() const noexcept
Return the Windows error code that caused the exception.
Definition: system_exception.cpp:42
virtual char const * what() const noexcept override
Return a message describing the exception that occurred.
Definition: system_exception.cpp:32