isc::Exception(file, line, what) {}
};
-/// @brief Attempt to update lease that was not there
-class NoSuchLease : public Exception {
-public:
- NoSuchLease(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
-};
-
/// @brief Data is truncated
class DataTruncated : public Exception {
public:
libkea_dhcpsrv_la_SOURCES += daemon.cc daemon.h
libkea_dhcpsrv_la_SOURCES += db_type.h
libkea_dhcpsrv_la_SOURCES += dhcp4o6_ipc.cc dhcp4o6_ipc.h
+libkea_dhcpsrv_la_SOURCES += dhcpsrv_exceptions.h
libkea_dhcpsrv_la_SOURCES += dhcpsrv_log.cc dhcpsrv_log.h
libkea_dhcpsrv_la_SOURCES += host.cc host.h
libkea_dhcpsrv_la_SOURCES += host_container.h
client_class_def.h \
csv_lease_file4.h \
csv_lease_file6.h \
+ dhcpsrv_exceptions.h \
d2_client_cfg.h \
d2_client_mgr.h \
daemon.h \
#include <config.h>
#include <dhcpsrv/cql_lease_mgr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/dhcpsrv_log.h>
#include <dhcp/duid.h>
#include <dhcp/hwaddr.h>
#include <dhcpsrv/cql_connection.h>
#include <dhcpsrv/cql_exchange.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
#include <boost/scoped_ptr.hpp>
///
/// @param lease4 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// exist.
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
///
/// @param lease6 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
--- /dev/null
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef DHCPSRV_EXCEPTIONS_H
+#define DHCPSRV_EXCEPTIONS_H
+
+#include <exceptions/exceptions.h>
+
+namespace isc {
+namespace dhcp {
+
+/// @brief Attempt to update lease that was not there
+class NoSuchLease : public Exception {
+public:
+ NoSuchLease(const char* file, size_t line, const char* what) :
+ isc::Exception(file, line, what) {}
+};
+
+
+} // end of namespace isc::dhcp
+} // end of namespace isc
+
+#endif // DHCPSRV_EXCEPTIONS_H
#include <config.h>
#include <database/database_connection.h>
#include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/dhcpsrv_log.h>
#include <dhcpsrv/lease_file_loader.h>
#include <dhcpsrv/memfile_lease_mgr.h>
#define MYSQL_LEASE_MGR_H
#include <dhcp/hwaddr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/mysql_connection.h>
///
/// @param lease4 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// exist.
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
///
/// @param lease6 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// exist.
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
#include <dhcp/duid.h>
#include <dhcp/hwaddr.h>
#include <dhcpsrv/dhcpsrv_log.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/pgsql_lease_mgr.h>
#include <boost/static_assert.hpp>
#define PGSQL_LEASE_MGR_H
#include <dhcp/hwaddr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/pgsql_connection.h>
#include <dhcpsrv/pgsql_exchange.h>
///
/// @param lease4 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// exist.
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
///
/// @param lease6 The lease to be updated.
///
- /// @throw isc::db::NoSuchLease Attempt to update a lease that did not
+ /// @throw isc::dhcp::NoSuchLease Attempt to update a lease that did not
/// exist.
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
#include <database/database_connection.h>
#include <database/db_exceptions.h>
#include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
#include <dhcpsrv/tests/test_utils.h>
// Try updating a lease not in the database.
lmptr_->deleteLease(ioaddress4_[2]);
- EXPECT_THROW(lmptr_->updateLease4(leases[2]), isc::db::NoSuchLease);
+ EXPECT_THROW(lmptr_->updateLease4(leases[2]), isc::dhcp::NoSuchLease);
}
void
EXPECT_THROW(lmptr_->updateLease6(leases[1]), isc::db::DbOperationError);
// Try updating a lease not in the database.
- EXPECT_THROW(lmptr_->updateLease6(leases[2]), isc::db::NoSuchLease);
+ EXPECT_THROW(lmptr_->updateLease6(leases[2]), isc::dhcp::NoSuchLease);
}
void