1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 04:11:35 +01:00

Dot11 now uses option_not_found. Sniffer catches malformed_packet rather than std::runtime_error while sniffing.

This commit is contained in:
Matias Fontanini
2013-04-19 14:06:59 -03:00
parent 75bd445bd3
commit 91bdcca577
7 changed files with 617 additions and 391 deletions

View File

@@ -36,8 +36,12 @@ namespace Tins {
/**
* \brief Exception thrown when an option is not found.
*/
class option_not_found : public std::exception {
class option_not_found : public std::runtime_error {
public:
option_not_found()
: std::runtime_error(std::string()) { }
// try to avoid allocations by doing this.
const char* what() const throw() {
return "Option not found";
}
@@ -49,7 +53,11 @@ public:
class malformed_packet : public std::runtime_error {
public:
malformed_packet()
: std::runtime_error("Malformed") { }
: std::runtime_error(std::string()) { }
const char* what() const throw() {
return "Option not found";
}
};
}