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(): m_s(s) {}
31 ~BaseException() throw() {}
32 virtual const char * what() const throw()
40 class AsyncQueuedException : public BaseException {
42 AsyncQueuedException(const std::string &s): BaseException(s) {}
45 class NotImplementedException : public BaseException {
47 NotImplementedException(const std::string &s): BaseException(s) {}
50 class AlreadyExistsException : public BaseException {
52 AlreadyExistsException(const std::string &s): BaseException(s) {}
55 class VersionMismatchException : public BaseException {
57 VersionMismatchException(const std::string &s): BaseException(s) {}
60 class FileNotGoodException : public BaseException {
62 FileNotGoodException(const std::string &s): BaseException(s) {}
65 class DatabaseException : public BaseException {
67 DatabaseException(const std::string &s): BaseException(s) {}
70 class SerializationError : public BaseException {
72 SerializationError(const std::string &s): BaseException(s) {}
75 class PacketError : public BaseException {
77 PacketError(const std::string &s): BaseException(s) {}
80 class LoadError : public BaseException {
82 LoadError(const std::string &s): BaseException(s) {}
85 class ContainerFullException : public BaseException {
87 ContainerFullException(const std::string &s): BaseException(s) {}
90 class SettingNotFoundException : public BaseException {
92 SettingNotFoundException(const std::string &s): BaseException(s) {}
95 class InvalidFilenameException : public BaseException {
97 InvalidFilenameException(const std::string &s): BaseException(s) {}
100 class ProcessingLimitException : public BaseException {
102 ProcessingLimitException(const std::string &s): BaseException(s) {}
105 class CommandLineError : public BaseException {
107 CommandLineError(const std::string &s): BaseException(s) {}
110 class ItemNotFoundException : public BaseException {
112 ItemNotFoundException(const std::string &s): BaseException(s) {}
115 class ServerError : public BaseException {
117 ServerError(const std::string &s): BaseException(s) {}
120 class ClientStateError : public BaseException {
122 ClientStateError(const std::string &s): BaseException(s) {}
125 class PrngException : public BaseException {
127 PrngException(const std::string &s): BaseException(s) {}
130 class ModError : public BaseException {
132 ModError(const std::string &s): BaseException(s) {}
137 Some "old-style" interrupts:
140 class InvalidNoiseParamsException : public BaseException {
142 InvalidNoiseParamsException():
143 BaseException("One or more noise parameters were invalid or require "
147 InvalidNoiseParamsException(const std::string &s):
152 class InvalidPositionException : public BaseException
155 InvalidPositionException():
156 BaseException("Somebody tried to get/set something in a nonexistent position.")
158 InvalidPositionException(const std::string &s):
163 class TargetInexistentException : public std::exception
165 virtual const char * what() const throw()
167 return "Somebody tried to refer to something that doesn't exist.";
171 class NullPointerException : public std::exception
173 virtual const char * what() const throw()
175 return "NullPointerException";