Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_interfaces_exception.h
diff options
context:
space:
mode:
authorPhil Nash2015-12-04 10:19:08 +0000
committerPhil Nash2015-12-04 10:19:08 +0000
commitfdc42d0af47f58fa13a42b685bbeaf55a8347673 (patch)
tree779ff3d692eeffd33353d89ad7697a592ab5201e /include/internal/catch_interfaces_exception.h
parentd758428fe297655e558a86cc6a013fcb1bcc8c7d (diff)
parentd274fc571c3980b5ac04cbe1416cf2205e6c99f7 (diff)
downloadcatch3-1.3.0.tar.gz
Merged from develop branchv1.3.0
- now v1.3.0
Diffstat (limited to 'include/internal/catch_interfaces_exception.h')
-rw-r--r--include/internal/catch_interfaces_exception.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/internal/catch_interfaces_exception.h b/include/internal/catch_interfaces_exception.h
index c2fc5bf5..67247e1e 100644
--- a/include/internal/catch_interfaces_exception.h
+++ b/include/internal/catch_interfaces_exception.h
@@ -9,15 +9,20 @@
#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
#include <string>
+#include <vector>
+
#include "catch_interfaces_registry_hub.h"
namespace Catch {
typedef std::string(*exceptionTranslateFunction)();
+ struct IExceptionTranslator;
+ typedef std::vector<const IExceptionTranslator*> ExceptionTranslators;
+
struct IExceptionTranslator {
virtual ~IExceptionTranslator();
- virtual std::string translate() const = 0;
+ virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
};
struct IExceptionTranslatorRegistry {
@@ -35,9 +40,12 @@ namespace Catch {
: m_translateFunction( translateFunction )
{}
- virtual std::string translate() const {
+ virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const CATCH_OVERRIDE {
try {
- throw;
+ if( it == itEnd )
+ throw;
+ else
+ return (*it)->translate( it+1, itEnd );
}
catch( T& ex ) {
return m_translateFunction( ex );