From 0d569d54d3da0426ccff098def8302886ced96a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eckl=2C=20M=C3=A1t=C3=A9?= <ecklm94@gmail.com> Date: Fri, 27 May 2016 14:55:01 +0200 Subject: [PATCH] =?UTF-8?q?DNS=20exception=20cser=C3=A9je?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server errort dobtam amikor egy nem támogatott típust kellett volna beállítani, de korábban egy másik ilyennél dns_exception-t dobtam. Így egységesebb. --- include/dns_answer.h | 2 +- src/dns_answer.cpp | 4 ++-- src/dns_server.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/dns_answer.h b/include/dns_answer.h index 15c7c63..d588ac2 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 28e2e5f..2e2541a 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 6f6dbc6..fedbaa3 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()); } //--- -- GitLab