diff --git a/third-party/realdds/include/realdds/dds-exceptions.h b/third-party/realdds/include/realdds/dds-exceptions.h index a21ad24cdb0..fbabab788bc 100644 --- a/third-party/realdds/include/realdds/dds-exceptions.h +++ b/third-party/realdds/include/realdds/dds-exceptions.h @@ -1,11 +1,9 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2022 Intel Corporation. All Rights Reserved. - +// Copyright(c) 2022-4 Intel Corporation. All Rights Reserved. #pragma once #include #include -#include // E.g.: @@ -14,8 +12,11 @@ #define DDS_THROW( ERR_TYPE, WHAT ) \ do \ { \ - LOG_ERROR( "throwing: " << WHAT ); \ - throw realdds::dds_##ERR_TYPE( rsutils::string::from() << WHAT ); \ + std::ostringstream os__; \ + os__ << WHAT; \ + auto log_message__ = os__.str(); \ + LOG_ERROR_STR( "throwing: " << log_message__ ); \ + throw realdds::dds_##ERR_TYPE( std::move( log_message__ ) ); \ } \ while( 0 ) @@ -26,15 +27,7 @@ namespace realdds { class dds_runtime_error : public std::runtime_error { public: - dds_runtime_error( std::string const& str ) - : std::runtime_error( str ) - { - } - - dds_runtime_error( char const* lpsz ) - : std::runtime_error( lpsz ) - { - } + using std::runtime_error::runtime_error; }; diff --git a/third-party/realdds/src/dds-device-server.cpp b/third-party/realdds/src/dds-device-server.cpp index b10a3277352..159ccf4f809 100644 --- a/third-party/realdds/src/dds-device-server.cpp +++ b/third-party/realdds/src/dds-device-server.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include using rsutils::json; diff --git a/third-party/realdds/src/dds-participant.cpp b/third-party/realdds/src/dds-participant.cpp index 3a75cbfabb8..24d8444f894 100644 --- a/third-party/realdds/src/dds-participant.cpp +++ b/third-party/realdds/src/dds-participant.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include