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