Exception<> is a replacement (subclass) for any std c++ exception class (e.g. the default 'std::exception'), which adds UNICODE String support. More...
#include <Exceptions.h>
Public Member Functions | |
virtual const char * | what () const noexcept override |
![]() | |
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 | |
template<typename... BASE_EXCEPTION_ARGS> | |
Exception (const Characters::String &reasonForError, BASE_EXCEPTION_ARGS... baseExceptionArgs) | |
![]() | |
nonvirtual const char * | _PeekAtNarrowSDKString_ () const |
Exception<> is a replacement (subclass) for any std c++ exception class (e.g. the default 'std::exception'), which adds UNICODE String support.
Stroika's Exception<> class is fully interoperable with the normal C++ exception classes, but its use offers two benefits: o It guarantees that UNICODE messages (including things like filenames) are properly preserved in the exception message, even if the system default code page (locale) does not allow representing those characters.
o It integrates neatly with the Stroika 'Activity' mechanism, whereby you declare current 'activities' on the stack and these are automatically integrated into exceptions to provide clearer messages (e.g. instead of getting the error message o "(errno: 13)" OR o "Permission denied" Stroika returns something like: o "Permission denied {errno: 13} while binding to INADDR_ANY:80, while constructing static content webserver."
Definition at line 157 of file Exceptions.h.
|
explicitprotected |
For BASE_EXCEPTION classes with constructors OTHER than just 'message' - you cannot use a 'using X = Exception(x)' but a subclass which uses this delegating method.
Definition at line 71 of file Exceptions.inl.
|
overridevirtualnoexcept |
Provide a 'c string' variant of the exception message. Convert the UNICODE string argument to a narrow-string (multibyte) in the current locale encoding.
Definition at line 77 of file Exceptions.inl.