Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
SpecsCpp::ExceptionHandlers::CStringExceptionHandler Class Reference

#include <CStringExceptionHandler.h>

Inheritance diagram for SpecsCpp::ExceptionHandlers::CStringExceptionHandler:
SpecsCpp::ILocalSpecExceptionHandler

Public Member Functions

bool handle_exception (std::exception_ptr *exception, LocalSpecExceptionFailureMessageCallbackFn *failureMessageCallback) override
 
- Public Member Functions inherited from SpecsCpp::ILocalSpecExceptionHandler
virtual ~ILocalSpecExceptionHandler ()=default
 
virtual bool handle_exception (std::exception_ptr *exception, LocalSpecExceptionFailureMessageCallbackFn *failureMessageCallback)=0
 

Additional Inherited Members

- Public Types inherited from SpecsCpp::ILocalSpecExceptionHandler
using LocalSpecExceptionFailureMessageCallbackFn = IFunctionPointer< void(IExceptionMessage *)>
 

Detailed Description

Definition at line 10 of file CStringExceptionHandler.h.

Member Function Documentation

◆ handle_exception()

bool SpecsCpp::ExceptionHandlers::CStringExceptionHandler::handle_exception ( std::exception_ptr *  exception,
LocalSpecExceptionFailureMessageCallbackFn failureMessageCallback 
)
inlineoverridevirtual

Implements SpecsCpp::ILocalSpecExceptionHandler.

Definition at line 12 of file CStringExceptionHandler.h.

15 {
16 try {
17 std::rethrow_exception(*exception);
18 } catch (const char* exceptionMessage) {
19 if (failureMessageCallback) {
20 SpecExceptionMessage failureMessage{exceptionMessage};
21 failureMessageCallback->invoke(&failureMessage);
22 }
23 return true;
24 } catch (...) {
25 return false;
26 }
27 }

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