[icinga-checkins] icinga.org: icinga2/feature/cxxabi: Add context traces to most exceptions

git at icinga.org git at icinga.org
Tue Aug 30 20:20:32 CEST 2016


Module: icinga2
Branch: feature/cxxabi
Commit: 35ae8cffc83135ba080f00941b2e7732e945779f
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=35ae8cffc83135ba080f00941b2e7732e945779f

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Aug 30 20:12:35 2016 +0200

Add context traces to most exceptions

---

 lib/base/exception.cpp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/base/exception.cpp b/lib/base/exception.cpp
index 8d8aa25..d0c8014 100644
--- a/lib/base/exception.cpp
+++ b/lib/base/exception.cpp
@@ -243,7 +243,11 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta
 		}
 	}
 
-	if (boost::get_error_info<ContextTraceErrorInfo>(ex) == NULL) {
+	const ContextTrace *ct = boost::get_error_info<ContextTraceErrorInfo>(ex);
+
+	if (ct) {
+		result << *ct;
+	} else {
 		result << std::endl;
 
 		if (!context)



More information about the icinga-checkins mailing list