Kea: iface_mgr_error_handler.h Source File

| Kea 3.2.0-git

iface_mgr_error_handler.h
Go to the documentation of this file.
1// Copyright (C) 2014-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef IFACE_MGR_ERROR_HANDLER_H
8#define IFACE_MGR_ERROR_HANDLER_H
9
34#define IFACEMGR_ERROR(ex_type, handler, iface, stream) \
35{ \
36 std::ostringstream ieoss__; \
37 ieoss__ << stream; \
38 std::string const error(ieoss__.str()); \
39 if (iface) { \
40 iface->addError(error); \
41 } \
42 if (handler) { \
43 handler(error); \
44 } else { \
45 isc_throw(ex_type, error); \
46 } \
47} \
48
49#endif // IFACE_MGR_ERROR_HANDLER_H