diff --git a/include/dns_answer.h b/include/dns_answer.h index 15c7c63ff2f75e4544d9c7bb07a44630ba5b521a..d588ac26fc87a09ef7c0b4633a0437f6b5363bc6 100644 --- a/include/dns_answer.h +++ b/include/dns_answer.h @@ -89,7 +89,7 @@ public: * The format should be treated on the side of the caller. * @param new_rdata Bytes to the rdata to store * @param new_rdata_len Number of bytes in new_rdata - * @throws server_error when unsupported DNS type is set + * @throws dns_exception when unsupported DNS type is set */ void set_rdata(const char *new_rdatas); diff --git a/src/dns_answer.cpp b/src/dns_answer.cpp index 28e2e5fe7e29c66f34dee010591cd9971050a40b..2e2541a8f7d6b31f8e567201e9ba0ecb6856025f 100644 --- a/src/dns_answer.cpp +++ b/src/dns_answer.cpp @@ -2,7 +2,7 @@ #include "../include/dns_answer.h" #include "../include/dns_types.h" -#include "../include/exceptions/server_error.h" +#include "../include/exceptions/dns_exception.h" dns_answer::dns_answer(const dns_answer& other) : dns_question(other), ttl(other.ttl), rd_length(other.rd_length) { rdata = new char[get_rd_length()]; @@ -41,7 +41,7 @@ void dns_answer::set_rdata(const char* new_rdata) { treat_TXT_rdata(new_rdata); break; default: - throw server_error("This record type is not supported."); + throw dns_exception("This record type is not supported."); } } diff --git a/src/dns_server.cpp b/src/dns_server.cpp index 6f6dbc67bc260d2e231850d2f6930f3e892784cb..fedbaa327c810ab67d2173ca728a4677de43f815 100644 --- a/src/dns_server.cpp +++ b/src/dns_server.cpp @@ -112,9 +112,9 @@ void dns_server::serve_one_request() { { log_on_demand(LOG_ERR, ex.what()); } - catch(server_error err) + catch(dns_exception ex) { - resp.set_error(err.what()); + resp.set_error(ex.what()); } //---