mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 21:29:54 +01:00
Fix build with CATCH_CONFIG_DISABLE_EXCEPTIONS enabled
This commit is contained in:
parent
4e4171420d
commit
e59fc2c3b3
@ -15,6 +15,7 @@
|
||||
#include "catch_interfaces_registry_hub.h"
|
||||
#include "catch_capture_matchers.h"
|
||||
#include "catch_run_context.h"
|
||||
#include "catch_enforce.h"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -46,6 +46,9 @@ namespace Catch {
|
||||
{}
|
||||
|
||||
std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
|
||||
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
|
||||
return "";
|
||||
#else
|
||||
try {
|
||||
if( it == itEnd )
|
||||
std::rethrow_exception(std::current_exception());
|
||||
@ -55,6 +58,7 @@ namespace Catch {
|
||||
catch( T& ex ) {
|
||||
return m_translateFunction( ex );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user