From 83ead387064fcbfba2377a16ef6578fb6eeb944b Mon Sep 17 00:00:00 2001 From: Andreas Waidler Date: Sun, 26 Sep 2010 13:32:52 +0200 Subject: [PATCH] Renamed RETHROW to CHAIN and improved its doc. --- include/libsex/throw.hxx | 5 ++++- tests/src/UsageExamples.cxx | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/libsex/throw.hxx b/include/libsex/throw.hxx index 036d103..3e6fb17 100644 --- a/include/libsex/throw.hxx +++ b/include/libsex/throw.hxx @@ -23,9 +23,12 @@ * Chains the previous exception and the newly created one * together. * + * @note The previous exception has to be accessible in + * this scope via the variable name @c e. + * * @see THROW */ -#define RETHROW(class, args...) \ +#define CHAIN(class, args...) \ {\ throw libsex::formatted(e, __FILE__, __LINE__, ##args); \ } diff --git a/tests/src/UsageExamples.cxx b/tests/src/UsageExamples.cxx index bfdc8cc..5ac6b5c 100644 --- a/tests/src/UsageExamples.cxx +++ b/tests/src/UsageExamples.cxx @@ -48,7 +48,7 @@ LIBSEX_DECLARE(libsex::Exception, Error); LIBSEX_DEFINE(libsex::Exception, Error, "Error!"); -#include // THROW and RETHROW +#include // THROW and CHAIN /** * How to simply create an exception. @@ -132,8 +132,8 @@ void UsageExamples::testChaining() } catch (MyException& e) { // Note that the variable name in // the catch clause must be e for - // the RETHROW macro to function. - RETHROW(MyException, "bar", 42); + // the CHAIN macro to function. + CHAIN(MyException, "bar", 42); } } catch (MyException& e) { const char* exp = "UsageExamples.cxx:136: bar is 42\n" -- 2.11.4.GIT