4#ifndef _Stroika_Foundation_Execution_Exceptions_h_
5#define _Stroika_Foundation_Execution_Exceptions_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
15#include <system_error>
19#include "Stroika/Foundation/Execution/Activity.h"
20#include "Stroika/Foundation/Execution/Throw.h"
52#if qCompilerAndStdLib_Supports_errno_t
132 template <
typename T>
133 nonvirtual T
As ()
const;
156 nonvirtual
void EnsureBuilt_ ()
const noexcept;
160 Characters::
String fRawErrorMessage_;
164 mutable string fSDKCharString_;
218 template <derived_from<exception> BASE_EXCEPTION = exception>
221 using inherited = BASE_EXCEPTION;
255#if qCompilerAndStdLib_CTADIgnoresConstructorRequiresClause_Buggy
294 const exception_ptr fBasedOnException;
430 template <
typename INT_TYPE>
475#if qStroika_Platform_POSIX or qStroika_Platform_Windows
476 [[
noreturn]]
void ThrowSystemErrNo ();
709 template <
typename CALL>
794 bool IsA (
const error_code&
ec, error_condition
cond)
noexcept;
795 bool IsA (
const system_error&
e, error_condition
cond)
noexcept;
796 bool IsA (
const exception&
e, error_condition
cond)
noexcept;
805 template <
typename F>
810#if qStroika_Platform_Windows
834 const error_category& Win32_error_category () noexcept;
842 bool IsWin32Error (const error_code& ec,
int win32Err) noexcept;
852#include "Exceptions.inl"
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Exception<> is a replacement (subclass) for any std c++ exception class (e.g. the default 'std::excep...
Exception()=delete
construct with just a message - BASE_EXCEPTION gets whatever it minimally needs.
virtual const char * what() const noexcept override
nonvirtual void ImbueActivities(const optional< Containers::Stack< Activity<> > > &activities)
Set, replace, or clear the activity stack. Any already-computed message text is discarded,...
nonvirtual optional< Containers::Stack< Activity<> > > GetActivities() const
nonvirtual Characters::String GetBasicErrorMessage() const
nonvirtual Characters::String GetFullErrorMessage() const
ExceptionStringHelper()=delete
activities default to NULLOPT - meaning "not specified" - which is different from "specified,...
nonvirtual const char * _PeekAtNarrowSDKString() const
NestedException contains a new higher level error message (typically based on argument basedOnExcepti...
void ThrowPOSIXErrNo(errno_t errNo=errno)
treats argument errNo as a POSIX errno value, and calls ThrowError () with an error_code constructed ...
auto Handle_ErrNoResultInterruption(CALL call) -> decltype(call())
Handle UNIX EINTR system call behavior - fairly transparently - just effectively removes them from th...
void ThrowPOSIXErrNoIfNull(void *returnValue)
auto TranslateExceptionToOptional(F &&f) -> optional< remove_cvref_t< invoke_result_t< F > > >
optional< error_code > GetAssociatedErrorCode(const exception_ptr &e) noexcept
void ThrowError(error_code ec)
throw a SystemErrorException with the given error_code - or std::bad_alloc for errc::not_enough_memor...
INT_TYPE ThrowPOSIXErrNoIfNegative(INT_TYPE returnCode)
bool IsA(const error_code &ec, error_condition cond) noexcept
Does this error MEAN the given condition - regardless of how it happens to be represented?