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(const std::string &s): BaseException(s) {}
48 class NotImplementedException : public BaseException {
50 NotImplementedException(const std::string &s): BaseException(s) {}
53 class AlreadyExistsException : public BaseException {
55 AlreadyExistsException(const std::string &s): BaseException(s) {}
58 class VersionMismatchException : public BaseException {
60 VersionMismatchException(const std::string &s): BaseException(s) {}
63 class FileNotGoodException : public BaseException {
65 FileNotGoodException(const std::string &s): BaseException(s) {}
68 class SerializationError : public BaseException {
70 SerializationError(const std::string &s): BaseException(s) {}
73 class LoadError : public BaseException {
75 LoadError(const std::string &s): BaseException(s) {}
78 class ContainerFullException : public BaseException {
80 ContainerFullException(const std::string &s): BaseException(s) {}
83 class SettingNotFoundException : public BaseException {
85 SettingNotFoundException(const std::string &s): BaseException(s) {}
88 class InvalidFilenameException : public BaseException {
90 InvalidFilenameException(const std::string &s): BaseException(s) {}
93 class ProcessingLimitException : public BaseException {
95 ProcessingLimitException(const std::string &s): BaseException(s) {}
98 class CommandLineError : public BaseException {
100 CommandLineError(const std::string &s): BaseException(s) {}
103 class ItemNotFoundException : public BaseException {
105 ItemNotFoundException(const std::string &s): BaseException(s) {}
108 class ServerError : public BaseException {
110 ServerError(const std::string &s): BaseException(s) {}
113 // Only used on Windows (SEH)
114 class FatalSystemException : public BaseException {
116 FatalSystemException(const std::string &s): BaseException(s) {}
119 class ClientStateError : public BaseException {
121 ClientStateError(std::string s): BaseException(s) {}
125 Some "old-style" interrupts:
128 class InvalidPositionException : public BaseException
131 InvalidPositionException():
132 BaseException("Somebody tried to get/set something in a nonexistent position.")
134 InvalidPositionException(const std::string &s):
139 class TargetInexistentException : public std::exception
141 virtual const char * what() const throw()
143 return "Somebody tried to refer to something that doesn't exist.";
147 class NullPointerException : public std::exception
149 virtual const char * what() const throw()
151 return "NullPointerException";