Skip to content
Snippets Groups Projects
Commit 0d569d54 authored by dnsadmin's avatar dnsadmin
Browse files

DNS exception cseréje

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.
parent 578247c1
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
* The format should be treated on the side of the caller. * The format should be treated on the side of the caller.
* @param new_rdata Bytes to the rdata to store * @param new_rdata Bytes to the rdata to store
* @param new_rdata_len Number of bytes in new_rdata * @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); void set_rdata(const char *new_rdatas);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "../include/dns_answer.h" #include "../include/dns_answer.h"
#include "../include/dns_types.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) { 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()]; rdata = new char[get_rd_length()];
...@@ -41,7 +41,7 @@ void dns_answer::set_rdata(const char* new_rdata) { ...@@ -41,7 +41,7 @@ void dns_answer::set_rdata(const char* new_rdata) {
treat_TXT_rdata(new_rdata); treat_TXT_rdata(new_rdata);
break; break;
default: default:
throw server_error("This record type is not supported."); throw dns_exception("This record type is not supported.");
} }
} }
......
...@@ -112,9 +112,9 @@ void dns_server::serve_one_request() { ...@@ -112,9 +112,9 @@ void dns_server::serve_one_request() {
{ {
log_on_demand(LOG_ERR, ex.what()); 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());
} }
//--- //---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment