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
29 class StrandedException
: public std::exception
35 StrandedException (const char* message
);
36 StrandedException (const std::string
& message
);
37 ~StrandedException () throw ();
40 * This is a virtual method of the std::exception class
51 * OpenStranded uses a classical Warning - Error - Fatal
52 * exception level scheme.
53 * You should use the following classes instead of
54 * their StrandedException base class
58 * NOTE: Implementation of warnings through exceptions is somewhat difficult,
59 * for you will most probably want to continue your function without disruption
60 * after throwing a Warning, exceptions will, however,
61 * always break out of the function
62 * Therefore you should not throw this exception
63 * unless there is another approach to this problem
65 class StrandedWarning
: public StrandedException
68 StrandedWarning (const char* message
);
69 StrandedWarning (const std::string
& message
);
76 class StrandedError
: public StrandedException
79 StrandedError (const char* message
);
80 StrandedError (const std::string
& message
);
87 class StrandedFatal
: public StrandedException
90 StrandedFatal (const char* message
);
91 StrandedFatal (const std::string
& message
);
97 #endif /* STRANDED_ERROR_HH */