2 * This file includes global error routines used throughout OpenStranded
4 * Copyright (C) 2008 Hermann Walth
6 * This file is part of OpenStranded
8 * OpenStranded is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * OpenStranded is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with OpenStranded. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef STRANDED_ERROR_HH
23 #define STRANDED_ERROR_HH
30 * The StrandedException base class.
31 * OpenStranded uses a classical Warning - Error - Fatal exception
33 * You should use the following classes instead of their StrandedException
35 * NOTE: Implementation of warnings through exceptions is somewhat difficult,
36 * for you will most probably want to continue your function without disruption
37 * after throwing a Warning, exceptions will, however, always break out of the
39 * Therefore you should not throw this exception if there is another
40 * approach to this problem.
41 * @see StrandedWarning
45 class StrandedException
: public std::exception
56 * @param message The error message
58 StrandedException (const char* message
);
62 * @param message The error message
64 StrandedException (const std::string
& message
);
69 ~StrandedException () throw ();
72 * This is a virtual method of the std::exception class
73 * @return The error message
79 * Print the error message.
88 * This class defines an Exception with the "Warning" level.
89 * Consider the comments on the StrandedException base class.
90 * @see StrandedException
92 class StrandedWarning
: public StrandedException
97 * @param message The error message
99 StrandedWarning (const char* message
);
103 * @param message The error message
105 StrandedWarning (const std::string
& message
);
108 * Print the error message.
109 * This method will print the error message preceded by an
110 * indicator of the error level.
118 * This class defines an Exception with the "Error" level.
119 * Consider the comments on the StrandedException base class.
120 * @see StrandedException
122 class StrandedError
: public StrandedException
127 * @param message The error message
129 StrandedError (const char* message
);
133 * @param message The error message
135 StrandedError (const std::string
& message
);
138 * Print the error message.
139 * This method will print the error message preceded by an
140 * indicator of the error level.
148 * This class defines an Exception with the "Fatal" level.
149 * Consider the comments on the StrandedException base class.
150 * @see StrandedException
152 class StrandedFatal
: public StrandedException
157 * @param message The error message
159 StrandedFatal (const char* message
);
163 * @param message The error message
165 StrandedFatal (const std::string
& message
);
168 * Print the error message.
169 * This method will print the error message preceded by an
170 * indicator of the error level.
176 #endif /* STRANDED_ERROR_HH */