From: Pieter Lexis Date: Fri, 15 Mar 2019 10:34:40 +0000 (+0100) Subject: GSQLBackend::getBeforeAndAfterNamesAbsolute: log qname in errors X-Git-Tag: dnsdist-1.4.0-alpha1~53^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2a92c1f2ab43ddfe9e9516db3b7b3fcf2447fa5;p=pdns GSQLBackend::getBeforeAndAfterNamesAbsolute: log qname in errors --- diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index 0c541e608..478a5878a 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -586,7 +586,7 @@ bool GSQLBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna d_afterOrderQuery_stmt->reset(); } catch(SSqlException &e) { - throw PDNSException("GSQLBackend unable to find before/after (after) for domain_id "+itoa(id)+": "+e.txtReason()); + throw PDNSException("GSQLBackend unable to find before/after (after) for domain_id "+itoa(id)+" and qname '"+ qname.toLogString() +"': "+e.txtReason()); } if(after.empty()) { @@ -604,7 +604,7 @@ bool GSQLBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna d_firstOrderQuery_stmt->reset(); } catch(SSqlException &e) { - throw PDNSException("GSQLBackend unable to find before/after (first) for domain_id "+itoa(id)+": "+e.txtReason()); + throw PDNSException("GSQLBackend unable to find before/after (first) for domain_id "+itoa(id)+" and qname '"+ qname.toLogString() + "': "+e.txtReason()); } } @@ -631,7 +631,7 @@ bool GSQLBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna d_beforeOrderQuery_stmt->reset(); } catch(SSqlException &e) { - throw PDNSException("GSQLBackend unable to find before/after (before) for domain_id "+itoa(id)+": "+e.txtReason()); + throw PDNSException("GSQLBackend unable to find before/after (before) for domain_id "+itoa(id)+" and qname '"+ qname.toLogString() + ": "+e.txtReason()); } if(! unhashed.empty()) @@ -659,7 +659,7 @@ bool GSQLBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qna d_lastOrderQuery_stmt->reset(); } catch(SSqlException &e) { - throw PDNSException("GSQLBackend unable to find before/after (last) for domain_id "+itoa(id)+": "+e.txtReason()); + throw PDNSException("GSQLBackend unable to find before/after (last) for domain_id "+itoa(id)+" and qname '"+ qname.toLogString() + ": "+e.txtReason()); } } else { before=qname;