Line data Source code
1 : // Copyright (c) 2013-2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/snaplogger
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : #pragma once
20 :
21 : /** \file
22 : * \brief Logger exceptions.
23 : *
24 : * This files declares a few exceptions that the logger uses when a
25 : * parameter is wrong. Note that many runtime errors get \em eaten
26 : * up by the system because there isn't much you can do if the logger
27 : * itself fails.
28 : *
29 : * However, some of the setup can generate exceptions because those
30 : * errors should be fixed before you go on. For example, if you try
31 : * to change a system severity level or define two `severity` objects
32 : * with the same name, then you'll get one of those exceptions. In
33 : * most cases, those do not need to be handled. Instead, they should
34 : * be fixed.
35 : */
36 :
37 :
38 : // libexcept lib
39 : //
40 : #include <libexcept/exception.h>
41 :
42 :
43 : namespace snaplogger
44 : {
45 :
46 :
47 :
48 0 : DECLARE_LOGIC_ERROR(logger_logic_error);
49 :
50 0 : DECLARE_MAIN_EXCEPTION(fatal_error);
51 30 : DECLARE_MAIN_EXCEPTION(logger_error);
52 :
53 0 : DECLARE_EXCEPTION(logger_error, conflict_error);
54 12 : DECLARE_EXCEPTION(logger_error, duplicate_error);
55 4 : DECLARE_EXCEPTION(logger_error, invalid_variable);
56 12 : DECLARE_EXCEPTION(logger_error, invalid_parameter);
57 0 : DECLARE_EXCEPTION(logger_error, invalid_severity);
58 2 : DECLARE_EXCEPTION(logger_error, not_a_message);
59 :
60 :
61 :
62 : } // namespace snaplogger
63 : // vim: ts=4 sw=4 et
|