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

#include <StdExceptionExceptionHandler.h>

Inheritance diagram for SpecsCpp::ExceptionHandlers::StdExceptionExceptionHandler:
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 9 of file StdExceptionExceptionHandler.h.

Member Function Documentation

◆ handle_exception()

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

Implements SpecsCpp::ILocalSpecExceptionHandler.

Definition at line 11 of file StdExceptionExceptionHandler.h.

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

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