1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 12:44:25 +01:00

Use custom exceptions everywhere

This commit is contained in:
Matias Fontanini
2017-05-13 10:59:15 -07:00
parent a5766a19c2
commit 64778f5412
14 changed files with 37 additions and 37 deletions

View File

@@ -59,7 +59,6 @@
#include "detail/smart_ptr.h"
using std::string;
using std::runtime_error;
/** \cond */
@@ -72,7 +71,7 @@ addrinfo* resolve_domain(const string& to_resolve, int family) {
return result;
}
else {
throw runtime_error("Could not resolve address");
throw Tins::exception_base("Could not resolve address");
}
}
@@ -121,7 +120,7 @@ HWAddress<6> resolve_hwaddr(const NetworkInterface& iface,
}
}
#endif
throw runtime_error("Could not resolve hardware address");
throw exception_base("Could not resolve hardware address");
}
HWAddress<6> resolve_hwaddr(IPv4Address ip, PacketSender& sender) {

View File

@@ -63,7 +63,6 @@ using std::string;
using std::set;
using std::ifstream;
using std::istream;
using std::runtime_error;
namespace Tins {
namespace Utils {
@@ -147,12 +146,12 @@ vector<char> query_route_table(int family) {
mib[4] = NET_RT_DUMP;
mib[5] = 0;
if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) {
throw runtime_error("sysctl failed");
throw exception_base("sysctl failed");
}
buf.resize(len);
if (sysctl(mib, 6, &buf[0], &len, NULL, 0) < 0) {
throw runtime_error("sysctl failed");
throw exception_base("sysctl failed");
}
return buf;