Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions olp-cpp-sdk-core/src/utils/BoostExceptionHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <stdlib.h>
#include <exception>

#include <boost/version.hpp>

namespace {
constexpr auto kLogTag = "BoostExceptionHandle";
}
Expand All @@ -36,5 +38,13 @@ OLP_CPP_SDK_DECL_EXPORT void throw_exception(const std::exception& e) {
OLP_SDK_LOG_ABORT_F(kLogTag, "Exception occurred: '%s'", e.what());
}

#if BOOST_VERSION >= 107300
OLP_CPP_SDK_DECL_EXPORT void throw_exception(
const std::exception& e, boost::source_location const& loc) {
OLP_SDK_LOG_ABORT_F(kLogTag, "Exception occurred: '%s' location: '%s'",
e.what(), loc.to_string().c_str());
}
#endif

} // namespace boost
#endif
Loading