]> granicus.if.org Git - icinga2/commitdiff
Add context traces to most exceptions
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 30 Aug 2016 18:12:35 +0000 (20:12 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 30 Aug 2016 18:46:23 +0000 (20:46 +0200)
fixes #9182

lib/base/exception.cpp

index 2679d031e773d960ec4a16fa3eb08803f96d3e49..3f3ec9e9edb818a18baa7fe0f58fff6b9f18e0f7 100644 (file)
@@ -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)