Skip to content
Snippets Groups Projects
Commit 177c4e82 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6547: CallManagerException: use runtime exceptions

Replace debus+throw by throw
parent bbd1eb8f
Branches
Tags
No related merge requests found
...@@ -361,23 +361,20 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal ...@@ -361,23 +361,20 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL)); link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL));
if (!link) { if (!link) {
_debug ("CallManager: Failed to get sip link"); throw CallManagerException("Failed to get sip link");
throw CallManagerException();
} }
SIPCall *call = link->getSIPCall (callID); SIPCall *call = link->getSIPCall (callID);
if (!call) { if (!call) {
_debug ("CallManager: Call id %d is not valid", callID.c_str()); throw CallManagerException("Call id " + callID + " is not valid");
throw CallManagerException();
} }
sfl::AudioRtpFactory * audioRtp = NULL; sfl::AudioRtpFactory * audioRtp = NULL;
audioRtp = call->getAudioRtp(); audioRtp = call->getAudioRtp();
if (!audioRtp) { if (!audioRtp) {
_debug ("CallManager: Failed to get AudioRtpFactory"); throw CallManagerException("Failed to get AudioRtpFactory");
throw CallManagerException();
} }
sfl::AudioZrtpSession * zSession = NULL; sfl::AudioZrtpSession * zSession = NULL;
...@@ -385,8 +382,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal ...@@ -385,8 +382,7 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal
zSession = audioRtp->getAudioZrtpSession(); zSession = audioRtp->getAudioZrtpSession();
if (!zSession) { if (!zSession) {
_debug ("CallManager: Failed to get AudioZrtpSession"); throw CallManagerException("Failed to get AudioZrtpSession");
throw CallManagerException();
} }
return zSession; return zSession;
......
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
#pragma GCC diagnostic warning "-Wunused-parameter" #pragma GCC diagnostic warning "-Wunused-parameter"
#include <dbus-c++/dbus.h> #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() { public:
return "A CallManagerException occured"; CallManagerException(const std::string& str="") :
} std::runtime_error("A CallManagerException occured: " + str) {}
}; };
namespace sfl namespace sfl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment