3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef EXCEPTIONS_HEADER
21 #define EXCEPTIONS_HEADER
27 class BaseException : public std::exception
30 BaseException(const std::string s) throw()
34 ~BaseException() throw() {}
35 virtual const char * what() const throw()
43 class AsyncQueuedException : public BaseException {
45 AsyncQueuedException(std::string s): BaseException(s) {}
48 class NotImplementedException : public BaseException {
50 NotImplementedException(std::string s): BaseException(s) {}
53 class AlreadyExistsException : public BaseException {
55 AlreadyExistsException(std::string s): BaseException(s) {}
58 class VersionMismatchException : public BaseException {
60 VersionMismatchException(std::string s): BaseException(s) {}
63 class FileNotGoodException : public BaseException {
65 FileNotGoodException(std::string s): BaseException(s) {}
68 class SerializationError : public BaseException {
70 SerializationError(std::string s): BaseException(s) {}
73 class LoadError : public BaseException {
75 LoadError(std::string s): BaseException(s) {}
78 class ContainerFullException : public BaseException {
80 ContainerFullException(std::string s): BaseException(s) {}
83 class SettingNotFoundException : public BaseException {
85 SettingNotFoundException(std::string s): BaseException(s) {}
88 class InvalidFilenameException : public BaseException {
90 InvalidFilenameException(std::string s): BaseException(s) {}
93 class ProcessingLimitException : public BaseException {
95 ProcessingLimitException(std::string s): BaseException(s) {}
98 class CommandLineError : public BaseException {
100 CommandLineError(std::string s): BaseException(s) {}
103 class ItemNotFoundException : public BaseException {
105 ItemNotFoundException(std::string s): BaseException(s) {}
108 class ServerError : public BaseException {
110 ServerError(std::string s): BaseException(s) {}
113 // Only used on Windows (SEH)
114 class FatalSystemException : public BaseException {
116 FatalSystemException(std::string s): BaseException(s) {}
120 Some "old-style" interrupts:
123 class InvalidPositionException : public BaseException
126 InvalidPositionException():
127 BaseException("Somebody tried to get/set something in a nonexistent position.")
129 InvalidPositionException(std::string s):
134 class TargetInexistentException : public std::exception
136 virtual const char * what() const throw()
138 return "Somebody tried to refer to something that doesn't exist.";
142 class NullPointerException : public std::exception
144 virtual const char * what() const throw()
146 return "NullPointerException";