Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
StdExceptionExceptionHandler.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
Specs/API.h
>
4
5
#include "../SpecExceptionMessage.h"
6
7
namespace
SpecsCpp::ExceptionHandlers
{
8
9
class
StdExceptionExceptionHandler
:
public
ILocalSpecExceptionHandler
{
10
public
:
11
bool
handle_exception
(
12
std::exception_ptr* exception,
13
LocalSpecExceptionFailureMessageCallbackFn
* failureMessageCallback
14
)
override
{
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
}
27
};
28
}
API.h
SpecsCpp::ExceptionHandlers::StdExceptionExceptionHandler
Definition
StdExceptionExceptionHandler.h:9
SpecsCpp::ExceptionHandlers::StdExceptionExceptionHandler::handle_exception
bool handle_exception(std::exception_ptr *exception, LocalSpecExceptionFailureMessageCallbackFn *failureMessageCallback) override
Definition
StdExceptionExceptionHandler.h:11
SpecsCpp::SpecExceptionMessage
Definition
SpecExceptionMessage.h:10
SpecsCpp::ExceptionHandlers
Definition
CStringExceptionHandler.h:8
SpecsCpp::ILocalSpecExceptionHandler
Definition
API.h:371
SpecsCpp::ILocalSpecExceptionHandler::LocalSpecExceptionFailureMessageCallbackFn
IFunctionPointer< void(IExceptionMessage *)> LocalSpecExceptionFailureMessageCallbackFn
Definition
API.h:377
Specs.Implementations
include
Specs
ExceptionHandlers
StdExceptionExceptionHandler.h
<3 Mrowr Purr