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
8
10 public:
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}
bool handle_exception(std::exception_ptr *exception, LocalSpecExceptionFailureMessageCallbackFn *failureMessageCallback) override
IFunctionPointer< void(IExceptionMessage *)> LocalSpecExceptionFailureMessageCallbackFn
Definition API.h:377