Commit 219879a5 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1331] Propagate exception

parent 7003eecf
......@@ -974,12 +974,8 @@ DatabaseUpdater::addRRset(const RRset& rrset) {
columns[Accessor::ADD_RDATA] = it->getCurrent().toText();
if (journaling_) {
journal[Accessor::DIFF_RDATA] = columns[Accessor::ADD_RDATA];
try {
accessor_->addRecordDiff(zone_id_, serial_,
Accessor::DIFF_ADD, journal);
}
// We ignore not implemented
catch (const isc::NotImplemented&) {}
accessor_->addRecordDiff(zone_id_, serial_, Accessor::DIFF_ADD,
journal);
}
accessor_->addRecordToZone(columns);
}
......@@ -1016,12 +1012,8 @@ DatabaseUpdater::deleteRRset(const RRset& rrset) {
params[Accessor::DEL_RDATA] = it->getCurrent().toText();
if (journaling_) {
journal[Accessor::DIFF_RDATA] = params[Accessor::DEL_RDATA];
try {
accessor_->addRecordDiff(zone_id_, serial_,
Accessor::DIFF_DELETE, journal);
}
// Don't fail if the backend can't store them
catch(const isc::NotImplemented&) {}
accessor_->addRecordDiff(zone_id_, serial_, Accessor::DIFF_DELETE,
journal);
}
accessor_->deleteRecordInZone(params);
}
......
......@@ -2871,16 +2871,16 @@ TEST_F(MockDatabaseClientTest, journalOnErase) {
}
/*
* Check that the exception isn't raised when the journal is not implemented.
* Check that exception is propagated when the journal is not implemented.
*/
TEST_F(MockDatabaseClientTest, journalNotImplemented) {
updater_ = client_->getUpdater(Name("null.example.org"), false, true);
EXPECT_NO_THROW(updater_->deleteRRset(*soa_));
EXPECT_THROW(updater_->deleteRRset(*soa_), isc::NotImplemented);
soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
"ns1.example.org. admin.example.org. "
"1234 3600 1800 2419201 7200"));
EXPECT_NO_THROW(updater_->addRRset(*soa_));
EXPECT_THROW(updater_->addRRset(*soa_), isc::NotImplemented);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment