diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index aaafcf6f2985ab0f4f688fd29cb0e6bc8420e041..1cf00a123e8f50e80cc8e0b7f69404208c0abec9 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -361,23 +361,20 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL)); if (!link) { - _debug ("CallManager: Failed to get sip link"); - throw CallManagerException(); + throw CallManagerException("Failed to get sip link"); } SIPCall *call = link->getSIPCall (callID); if (!call) { - _debug ("CallManager: Call id %d is not valid", callID.c_str()); - throw CallManagerException(); + throw CallManagerException("Call id " + callID + " is not valid"); } sfl::AudioRtpFactory * audioRtp = NULL; audioRtp = call->getAudioRtp(); if (!audioRtp) { - _debug ("CallManager: Failed to get AudioRtpFactory"); - throw CallManagerException(); + throw CallManagerException("Failed to get AudioRtpFactory"); } sfl::AudioZrtpSession * zSession = NULL; @@ -385,8 +382,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal zSession = audioRtp->getAudioZrtpSession(); if (!zSession) { - _debug ("CallManager: Failed to get AudioZrtpSession"); - throw CallManagerException(); + throw CallManagerException("Failed to get AudioZrtpSession"); } return zSession; diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index daca254d9e97e58b6303c03e5f4914f88ff4c522..9c65a5802365a50154756829155457939e670937 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -43,13 +43,13 @@ #pragma GCC diagnostic warning "-Wunused-parameter" #include <dbus-c++/dbus.h> -#include <exception> +#include <stdexcept> -class CallManagerException: public std::exception +class CallManagerException: public std::runtime_error { - virtual const char* what() const throw() { - return "A CallManagerException occured"; - } + public: + CallManagerException(const std::string& str="") : + std::runtime_error("A CallManagerException occured: " + str) {} }; namespace sfl