15#import "Foundation/Foundation.h"
24 m_translators.push_back( std::unique_ptr<const IExceptionTranslator>( translator ) );
27#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
35 @catch (NSException *exception) {
47 if (std::current_exception() ==
nullptr) {
48 return "Non C++ exception. Possibly a CLR exception.";
53 catch( TestFailureException& ) {
54 std::rethrow_exception(std::current_exception());
56 catch( std::exception& ex ) {
59 catch( std::string& msg ) {
62 catch(
const char* msg ) {
66 return "Unknown exception";
71 if (m_translators.empty()) {
72 std::rethrow_exception(std::current_exception());
74 return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end());
80 CATCH_INTERNAL_ERROR(
"Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
84 CATCH_INTERNAL_ERROR(
"Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
#define CATCH_INTERNAL_ERROR(msg)
std::string translateActiveException() const override
virtual void registerTranslator(const IExceptionTranslator *translator)
~ExceptionTranslatorRegistry()
std::string tryTranslators() const
std::string stringify(const T &e)