Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::TimeOutException Class Reference

#include <TimeOutException.h>

Inheritance diagram for Stroika::Foundation::Execution::TimeOutException:
Stroika::Foundation::Execution::SystemErrorException< BASE_EXCEPTION > Stroika::Foundation::Execution::Exception< BASE_EXCEPTION > Stroika::Foundation::Execution::ExceptionStringHelper

Public Member Functions

 TimeOutException ()
 
- Public Member Functions inherited from Stroika::Foundation::Execution::Exception< BASE_EXCEPTION >
virtual const char * what () const noexcept override
 
- Public Member Functions inherited from Stroika::Foundation::Execution::ExceptionStringHelper
 ExceptionStringHelper ()=delete
 
nonvirtual Characters::String GetBasicErrorMessage () const
 
nonvirtual Characters::String GetFullErrorMessage () const
 
nonvirtual Containers::Stack< Activity<> > GetActivities () const
 
template<typename T >
nonvirtual T As () const
 

Static Public Attributes

static const TimeOutException kThe
 

Additional Inherited Members

- Protected Member Functions inherited from Stroika::Foundation::Execution::SystemErrorException< BASE_EXCEPTION >
template<typename... BASE_EXCEPTION_ARGS>
 SystemErrorException (const Characters::String &reasonForError, BASE_EXCEPTION_ARGS... baseExceptionArgs)
 
- Protected Member Functions inherited from Stroika::Foundation::Execution::Exception< BASE_EXCEPTION >
template<typename... BASE_EXCEPTION_ARGS>
 Exception (const Characters::String &reasonForError, BASE_EXCEPTION_ARGS... baseExceptionArgs)
 
- Protected Member Functions inherited from Stroika::Foundation::Execution::ExceptionStringHelper
nonvirtual const char * _PeekAtNarrowSDKString_ () const
 

Detailed Description

Throw this when something (typically a waitable event, but could be anything code is waiting for) times out.

Note
- Many low level functions map OS / platform exceptions to this type as appropriate (via
See also
ThrowPOSIXErrNo and
ThrowSystemErrNo)
Note
Though you can use

and that will work for catching nearly any timeout exception thrown by Stroika, it is often better to use:

catch (const system_error& e) {
if (e.code () == errc::timed_out) { // and maybe check errc::stream_timeout
...
}
}

since that will catch timeout exceptions thrown by non-Stroika-based components, and this form will still work with Activities and UNICODE exception message handling, if you use Characters::ToString (e); alternatively you can use: catch (const SystemErrorException& e) { if (e.code () == errc::timed_out) { ... } // now directly look at String message and Activies etc... } catch (const system_error& e) { if (e.code () == errc::timed_out) { ... } }

Definition at line 55 of file TimeOutException.h.

Constructor & Destructor Documentation

◆ TimeOutException()

TimeOutException::TimeOutException ( )

when not specified, the error_code defaults to make_error_code (errc::timed_out)

Definition at line 16 of file TimeOutException.cpp.

Member Data Documentation

◆ kThe

const TimeOutException Stroika::Foundation::Execution::TimeOutException::kThe
static

CAN be used when there is no message argument.

Definition at line 69 of file TimeOutException.h.


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