2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-09 18:35:17 +00:00
Files
kea/src/lib/dhcpsrv/db_exceptions.h

55 lines
1.7 KiB
C
Raw Normal View History

// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef DB_EXCEPTIONS_H
#define DB_EXCEPTIONS_H
#include <exceptions/exceptions.h>
namespace isc {
namespace dhcp {
/// @brief Multiple lease records found where one expected
class MultipleRecords : public Exception {
public:
MultipleRecords(const char* file, size_t line, const char* what) :
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:
DataTruncated(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
};
/// @brief Database duplicate entry error
class DuplicateEntry : public Exception {
public:
DuplicateEntry(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
};
};
};
#endif