Skip to content

Commit e565e8d

Browse files
Fix unreachable fallback in DiagnosticInformation(<eptr>)
This was likely meant as a fallback for non-`std::exception` exception pointers, but it would never have been reached, because `(std|boost)::rethrow_exception()` would have thrown those out of the function scope. This fixes the fallback by making it a catch handler and also using the more direct way of getting this fallback diagnostic info inside a catch handler.
1 parent 1a52530 commit e565e8d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/base/exception.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ String icinga::DiagnosticInformation(const std::exception_ptr& eptr, bool verbos
298298
std::rethrow_exception(eptr);
299299
} catch (const std::exception& ex) {
300300
return DiagnosticInformation(ex, verbose, pt ? &stack : nullptr, pc ? &context : nullptr);
301+
} catch (...) {
302+
return boost::current_exception_diagnostic_information();
301303
}
302-
303-
return boost::diagnostic_information(eptr);
304304
}
305305

306306
ScriptError::ScriptError(String message)

0 commit comments

Comments
 (0)