}
}
- if (!lease_exists && !LeaseMgrFactory::instance().addLease(lease)) {
- LOG_ERROR(lease4_logger, DHCP4_SERVER_INITIATED_DECLINE_ADD_FAILED)
- .arg(query->getLabel())
- .arg(lease->addr_.toText());
- return;
+ if (!lease_exists) {
+ bool done;
+ try {
+ done = LeaseMgrFactory::instance().addLease(lease);
+ } catch (const Exception& ex) {
+ done = false;
+ }
+ if (!done) {
+ LOG_ERROR(lease4_logger, DHCP4_SERVER_INITIATED_DECLINE_ADD_FAILED)
+ .arg(query->getLabel())
+ .arg(lease->addr_.toText());
+ return;
+ }
}
}