diff --git a/RELEASE_NOTES b/RELEASE_NOTES index b615cf891..110c1632d 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,4 +1,4 @@ -[Unreleased] +9.3.1 [UNRELEASED] ============ 1. Add -pedantic for GCC/Clang and debug mode (#441). This change can generate @@ -12,6 +12,7 @@ 6. EventConsumer::connect_event: Fix misleading indentation (#441) 7. PollThread: Fix multiline macro definitions (#451) 8. Generate static library (#17) and fix compilation definitions (#437) +9. Replace asserts in EventConsumer::initialize_received_from_admin with exceptions (#453) 9.3.0 ===== diff --git a/cppapi/client/event.cpp b/cppapi/client/event.cpp index c10fa07b9..257e6b641 100644 --- a/cppapi/client/event.cpp +++ b/cppapi/client/event.cpp @@ -1837,6 +1837,13 @@ void Tango::EventConsumer::initialize_received_from_admin(const Tango::DevVarLon const string &adm_name, bool device_from_env_var) { + if(dvlsa->lvalue.length() == 0) + { + EventSystemExcept::throw_exception(API_NotSupported, + "Server did not send its tango lib version. The server is possibly too old. The event system is not initialized!", + "EventConsumer::initialize_received_from_admin()"); + } + long server_tango_lib_ver = dvlsa->lvalue[0]; //event name is used for zmq topics filtering @@ -1844,7 +1851,7 @@ void Tango::EventConsumer::initialize_received_from_admin(const Tango::DevVarLon if (server_tango_lib_ver >= 930) { received_from_admin.event_name = (dvlsa->svalue[dvlsa->svalue.length() - 2]); - received_from_admin.channel_name = (dvlsa->svalue[dvlsa->svalue.length() - 1]); + received_from_admin.channel_name = (dvlsa->svalue[dvlsa->svalue.length() - 1]); } else { @@ -1860,9 +1867,21 @@ void Tango::EventConsumer::initialize_received_from_admin(const Tango::DevVarLon received_from_admin.channel_name = adm_name_lower; } - assert(!(received_from_admin.event_name.empty())); + if (received_from_admin.event_name.empty()) + { + EventSystemExcept::throw_exception(API_NotSupported, + "Server did not send the event name. The server is possibly too old. The event system is not initialized!", + "EventConsumer::initialize_received_from_admin()"); + + } + cout4 << "received_from_admin.event_name = " << received_from_admin.event_name << endl; - assert(!(received_from_admin.channel_name.empty())); + if (received_from_admin.channel_name.empty()) + { + EventSystemExcept::throw_exception(API_NotSupported, + "Server did not send the channel name. The server is possibly too old. The event system is not initialized!", + "EventConsumer::initialize_received_from_admin()"); + } cout4 << "received_from_admin.channel_name = " << received_from_admin.channel_name << endl; }