Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::ExceptionStringHelper Class Reference

#include <Exceptions.h>

Inheritance diagram for Stroika::Foundation::Execution::ExceptionStringHelper:
Stroika::Foundation::Execution::Exception< runtime_error > Stroika::Foundation::Execution::Exception< system_error > Stroika::Foundation::Execution::Exception< filesystem_error > Stroika::Foundation::Execution::Exception< BASE_EXCEPTION > Stroika::Foundation::Execution::SystemErrorException< filesystem_error > Stroika::Foundation::Execution::RuntimeErrorException< BASE_EXCEPTION > Stroika::Foundation::Execution::SystemErrorException< BASE_EXCEPTION > Stroika::Foundation::IO::FileSystem::Exception Stroika::Foundation::Characters::CharacterEncodingException Stroika::Foundation::DataExchange::BadFormatException Stroika::Foundation::DataExchange::InternetMediaTypeNotSupportedException Stroika::Foundation::DataExchange::XML::DOM::XPath::XPathExpressionNotSupported Stroika::Foundation::Database::Exception Stroika::Foundation::Execution::FeatureNotSupportedException Stroika::Foundation::Execution::InvalidCommandLineArgument Stroika::Foundation::Execution::NestedException Stroika::Foundation::Execution::OperationNotSupportedException Stroika::Foundation::Execution::ProcessRunner::Exception Stroika::Foundation::IO::Network::HTTP::Exception Stroika::Foundation::IO::Network::InternetProtocol::ICMP::V4::DestinationUnreachableException Stroika::Foundation::IO::Network::InternetProtocol::ICMP::V4::TTLExpiredException Stroika::Foundation::Streams::EOFException Stroika::Foundation::Streams::EWouldBlock Stroika::Foundation::Execution::TimeOutException

Public Member Functions

 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
 

Protected Member Functions

nonvirtual const char * _PeekAtNarrowSDKString_ () const
 

Detailed Description

This is a base class for Execution::Exception<> template, which gets mixed with the std c++ exception class, to mix in Stroika string support.

This probably should NOT be used directly.

Definition at line 62 of file Exceptions.h.

Constructor & Destructor Documentation

◆ ExceptionStringHelper()

Stroika::Foundation::Execution::ExceptionStringHelper::ExceptionStringHelper ( )
delete

If the current activities are NOT provided explicitly, they are copied from Execution::CaptureCurrentActivities ().

Member Function Documentation

◆ GetBasicErrorMessage()

Characters::String Stroika::Foundation::Execution::ExceptionStringHelper::GetBasicErrorMessage ( ) const

Return error message without added 'activities'.

Definition at line 31 of file Exceptions.inl.

◆ GetFullErrorMessage()

Characters::String Stroika::Foundation::Execution::ExceptionStringHelper::GetFullErrorMessage ( ) const

Return error message with added 'activities'

Definition at line 35 of file Exceptions.inl.

◆ GetActivities()

Containers::Stack< Activity<> > Stroika::Foundation::Execution::ExceptionStringHelper::GetActivities ( ) const

Return the activity stack from when the exception was thrown. NOTE - see @Activity<>. This has little todo with the thread runtime stack. It refers to a logical stack of declared Activity<> objects.

Definition at line 39 of file Exceptions.inl.

◆ As()

template<typename T >
nonvirtual T Stroika::Foundation::Execution::ExceptionStringHelper::As ( ) const

Only implemented for o wstring o String

This returns the message callers should display to represent the error (e.g. in exception::c_str ()). For now, it returns GetFullErrorMessage () - but may someday change.

◆ _PeekAtNarrowSDKString_()

const char * Stroika::Foundation::Execution::ExceptionStringHelper::_PeekAtNarrowSDKString_ ( ) const
protected

In order for subclasses to support the c++ exception::c_str () API, we need to convert the string/message to an SDKChar string, and have that lifetime be very long. So we store it in a std::string. And this function returns the pointer to that string. This object is immutable, so that the lifetime of the underlying return const char* is as long as this object.

Definition at line 53 of file Exceptions.inl.


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