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
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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment