...rather than any further backend exception caused by
abortTransaction(), which will be much less helpful.
Using the sqlite backend on a full filesystem, pdnsutil delete-zone now
correctly reports "database or disk is full" instead of "cannot rollback
- no transaction is active" which no human can make sense of in this
situation.
auto rrs = vector<DNSResourceRecord>{rr};
if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) {
- sd.db->abortTransaction();
cerr << "Backend did not replace SOA record. Backend might not support this operation." << endl;
+ sd.db->abortTransaction();
return -1;
}
return EXIT_SUCCESS;
}
} catch (...) {
- di.backend->abortTransaction();
+ try {
+ di.backend->abortTransaction();
+ } catch (...) {
+ // Ignore this exception (which is likely "cannot rollback - no
+ // transaction is active"), we have a more important one we want to
+ // rethrow.
+ }
throw;
}