Kea  1.9.9-git
iface_mgr_error_handler.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2017 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 
33 #define IFACEMGR_ERROR(ex_type, handler, stream) \
34 { \
35  std::ostringstream ieoss__; \
36  ieoss__ << stream; \
37  if (handler) { \
38  handler(ieoss__.str()); \
39  } else { \
40  isc_throw(ex_type, ieoss__.str()); \
41  } \
42 } \
43 
44 #endif // IFACE_MGR_ERROR_HANDLER_H