}
}
-void GSQLBackend::feedComment(const Comment& comment)
+bool GSQLBackend::feedComment(const Comment& comment)
{
try {
reconnectIfNeeded();
catch (SSqlException &e) {
throw PDNSException("GSQLBackend unable to feed comment for RRSet '" + comment.qname.toLogString() + "|" + comment.qtype.toString() + "': "+e.txtReason());
}
+
+ return true;
}
bool GSQLBackend::replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<Comment>& comments)
bool listComments(const uint32_t domain_id) override;
bool getComment(Comment& comment) override;
- void feedComment(const Comment& comment) override;
+ bool feedComment(const Comment& comment) override;
bool replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<Comment>& comments) override;
string directBackendCmd(const string &query) override;
bool searchRecords(const string &pattern, int maxResults, vector<DNSResourceRecord>& result) override;
return false;
}
- virtual void feedComment(const Comment& /* comment */)
+ virtual bool feedComment(const Comment& /* comment */)
{
+ return false;
}
virtual bool replaceComments(const uint32_t /* domain_id */, const DNSName& /* qname */, const QType& /* qt */, const vector<Comment>& /* comments */)
Comment c;
while(src->getComment(c)) {
c.domain_id = di_new.id;
- tgt->feedComment(c);
+ if (!tgt->feedComment(c)) {
+ throw PDNSException("Target backend does not support comments - remove them first");
+ }
nc++;
}
}
}
for(Comment& c : new_comments) {
c.domain_id = di.id;
- di.backend->feedComment(c);
+ if (!di.backend->feedComment(c)) {
+ throw ApiException("Hosting backend does not support editing comments.");
+ }
}
updateDomainSettingsFromDocument(B, di, zonename, document, !new_records.empty());