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

* #6547: AudioZrtp: use runtime exceptions

Also support custom exception strings
parent dbe4aff6
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ void AudioZrtpSession::initializeZid (void)
{
if (_zidFilename.empty()) {
throw ZrtpZidException();
throw ZrtpZidException("zid filename empty");
}
std::string zidCompleteFilename;
......@@ -131,12 +131,12 @@ void AudioZrtpSession::initializeZid (void)
if (remove (zidCompleteFilename.c_str()) !=0) {
_debug ("Failed to remove zid file because of: %s", strerror (errno));
throw ZrtpZidException();
throw ZrtpZidException("zid file deletion failed");
}
if (initialize (zidCompleteFilename.c_str()) < 0) {
_debug ("ZRTP initialization failed");
throw ZrtpZidException();
throw ZrtpZidException("zid initialization failed");
}
return;
......
......@@ -31,6 +31,7 @@
#define __SFL_AUDIO_ZRTP_SESSION_H__
#include <cstddef>
#include <stdexcept>
using std::ptrdiff_t;
#include <ccrtp/rtp.h>
......@@ -46,11 +47,11 @@ class SIPCall;
namespace sfl
{
class ZrtpZidException: public std::exception
class ZrtpZidException: public std::runtime_error
{
virtual const char* what() const throw() {
return "ZRTP ZID initialization failed.";
}
public:
ZrtpZidException (const std::string& str="") :
std::runtime_error("ZRTP ZID initialization failed." + str) {}
};
// class AudioZrtpSession : public ost::TimerPort, public ost::SymmetricZRTPSession, public AudioRtpRecordHandler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment