From: jmo Date: Fri, 29 Feb 2008 16:16:28 +0000 (+0000) Subject: added more meaningful exception text X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=6e4cfeb813b1da364395b2da6e3762e0abd2ac70;p=senf.git added more meaningful exception text git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@721 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/DVB/DVBDemuxHandles.cc b/Socket/Protocols/DVB/DVBDemuxHandles.cc index 3016a52..a8f33a7 100644 --- a/Socket/Protocols/DVB/DVBDemuxHandles.cc +++ b/Socket/Protocols/DVB/DVBDemuxHandles.cc @@ -46,8 +46,9 @@ prefix_ void senf::DVBDemuxSectionSocketProtocol::init_client(unsigned short ada std::string devDemux = str( boost::format( "/dev/dvb/adapter%d/demux%d") % adapter % device); int f = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK); - if (f < 0) - throw SystemException(); + if (f < 0){ + throw SystemException( "Could not open demux device of DVB adapter ") << devDemux; + } fd(f); } @@ -61,7 +62,7 @@ prefix_ void senf::DVBDemuxSectionSocketProtocol::setSectionFilter(struct dmx_sc const { if (::ioctl(fd(), DMX_SET_FILTER, filter) < 0) - throw SystemException(); + throw SystemException("Could not set section filter of DVB adapter"); } // ---------------------------------------------------------------- @@ -73,7 +74,7 @@ prefix_ void senf::DVBDemuxPESSocketProtocol::init_client(unsigned short adapter "/dev/dvb/adapter%d/demux%d") % adapter % device); int f = open(devDemux.c_str(), O_RDONLY | O_NONBLOCK); if (f < 0) - throw SystemException(); + throw SystemException( "Could not open demux device of DVB adapter ") << devDemux; fd(f); } @@ -87,7 +88,7 @@ prefix_ void senf::DVBDemuxPESSocketProtocol::setPESFilter(struct dmx_pes_filter const { if (::ioctl(fd(), DMX_SET_PES_FILTER, filter) < 0) - throw SystemException(); + throw SystemException("Could not set PES filter of DVB adapter"); } // ---------------------------------------------------------------- @@ -99,7 +100,7 @@ prefix_ void senf::DVBDvrSocketProtocol::init_client(unsigned short adapter, uns "/dev/dvb/adapter%d/dvr%d") % adapter % device); int f = open(devDvr.c_str(), O_RDONLY | O_NONBLOCK); if (f < 0) - throw SystemException(); + throw SystemException( "Could not open dvr device of DVB adapter ") << devDvr; fd(f); } diff --git a/Socket/Protocols/DVB/DVBFrontendHandle.cc b/Socket/Protocols/DVB/DVBFrontendHandle.cc index 28ef5fa..1e47c7a 100644 --- a/Socket/Protocols/DVB/DVBFrontendHandle.cc +++ b/Socket/Protocols/DVB/DVBFrontendHandle.cc @@ -47,7 +47,8 @@ prefix_ void senf::DVBFrontendSocketProtocol::init_client(uint8_t adapter, boost "/dev/dvb/adapter%d/frontend%d") % adapter % device); int f = open(devFrontend.c_str(), O_RDONLY | O_NONBLOCK); if (f < 0) - throw SystemException(); + throw SystemException("Could not open frontend device of DVB adapter ")<< devFrontend; + fd(f); } @@ -67,7 +68,7 @@ prefix_ void senf::DVBFrontendSocketProtocol::signalStrength(int16_t *strength) const { if (::ioctl(fd(), FE_READ_SIGNAL_STRENGTH, strength) < 0) - throw SystemException(); + throw SystemException( "Could not get signal strength of DVB adapter"); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Socket/Protocols/Raw/TunTapSocketHandle.cc b/Socket/Protocols/Raw/TunTapSocketHandle.cc index 8784b99..6734b8a 100644 --- a/Socket/Protocols/Raw/TunTapSocketHandle.cc +++ b/Socket/Protocols/Raw/TunTapSocketHandle.cc @@ -50,7 +50,7 @@ prefix_ void senf::TapSocketProtocol::init_client(std::string const & interface_ { int f; if ( (f = ::open("/dev/net/tun", O_RDWR)) < 0 ) - throw SystemException(); + throw SystemException( "Could not open tap control device: /dev/net/tun"); struct ifreq ifr; ::memset( &ifr, 0, sizeof(ifr)); ifr.ifr_flags = IFF_TAP; @@ -58,7 +58,7 @@ prefix_ void senf::TapSocketProtocol::init_client(std::string const & interface_ ifr.ifr_flags |= IFF_NO_PI; interface_name.copy( ifr.ifr_name, IFNAMSIZ); if (::ioctl(f, TUNSETIFF, (void *) &ifr) < 0 ) - throw SystemException(); + throw SystemException( "Could not create tap device: ") << ifr.ifr_name; fd(f); }